Deleting Documents

📌 deleteOne()

Deletes the first document that matches the condition.

db.reviews.deleteOne({"_id": ObjectID("56458bggfjhg")})

📌 deleteMany()

Deletes all the documents that match the condition.

db.reviews.deleteMany({"reviewer_id": 759723314})

Last updated