10/7/2019 - 9:41 AM

Cheat Code - delete

// The remove() Method
// MongoDB's remove() method is used to remove a document from the collection. 
// remove() method accepts two parameters. One is deletion criteria and second is justOne flag.
// deletion criteria − (Optional) deletion criteria according to documents will be removed.
// justOne − (Optional) if set to true or 1, then remove only one document.

db.mycol.remove({'title':'MongoDB Overview'})
db.COLLECTION_NAME.remove({'title':'MongoDB Overview'},1)

// remove all docs