Created
December 27, 2020 15:28
-
-
Save sedataktas/3f72ff6cdeab67c204517d5468e6b4a6 to your computer and use it in GitHub Desktop.
DeleteBook in mongodb with golang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func DeleteBook(id primitive.ObjectID) error { | |
| _, err := BooksCollection.DeleteOne(Ctx, bson.D{{"_id", id}}) | |
| if err != nil { | |
| return err | |
| } | |
| return nil | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment