In MongoDB which function is used to delete document/s code example
Example 1: how to delete a document in mongodb
to delete a document
db.games.deleteOne({name:"Snake"})
Example 2: how to delete subdocument mongodb
db.getCollection('products').update({},
{$pull: {reviews:
{user: ObjectId("5f6e2e0b70eb0208fc84011a")}}},
{multi: true})