How do i delete a document in a collection on mongodb?
-
Related:
How do i insert a document into a collection in mongodb?
How do i read a collection in mongodb?
How do i update a collection on mongodb?MongoDB documentation for deleteOne: https://docs.mongodb.com/manual/reference/method/db.collection.deleteOne/
Delete a document with a specific id.
> db.softwarelist.deleteOne({_id : ObjectId("5c263b8b4ef440e31fc0405f")}) { "acknowledged" : true, "deletedCount" : 1 }
There are other methods that delete more than on document at a time.
© Lightnetics 2024