Closed yasuto2002 closed 1 year ago
coll := client.Database("sample_mflix").Collection("movies") filter := bson.D{{"title", "Twilight"}} result, err := coll.DeleteOne(context.TODO(), filter)
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
ドキュメントを削除する
idを指定して削除