how to delete a document in mongodb
to delete a document
db.games.deleteOne({name:"Snake"})
how to delete a document in mongodb
to delete a document
db.games.deleteOne({name:"Snake"})
how to delete subdocument mongodb
db.getCollection('products').update({},
{$pull: {reviews:
{user: ObjectId("5f6e2e0b70eb0208fc84011a")}}},
{multi: true})
delete one mongo db
db.collection.deleteOne()
# deletes the first document that matches the filter.
# Use a field that is part of a unique index such as _id for precise deletions.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us