yasuto2002 / SyncMemo

0 stars 0 forks source link

boardを削除する機能を追加する #78

Closed yasuto2002 closed 1 year ago

yasuto2002 commented 1 year ago

ドキュメントを削除する

coll := client.Database("sample_mflix").Collection("movies")
filter := bson.D{{"title", "Twilight"}}
result, err := coll.DeleteOne(context.TODO(), filter)

idを指定して削除

id, err := primitive.ObjectIDFromHex(boardId)
...
filter := &bson.M{"_id": id, "mail": mail}

https://www.mongodb.com/docs/drivers/go/current/usage-examples/deleteOne/#std-label-golang-delete-one https://www.mongodb.com/docs/drivers/go/current/usage-examples/deleteOne/#std-label-golang-delete-one