Deleting data

Deleting documents works almost exactly like find(), except instead of finding and returning results, it deletes those documents that match the search criteria:

> db.newCollection.remove({ name: 'Jason Krol' }) 

If you want the nuclear option, you can use the drop() function, which will remove every document in a collection:

> db.newCollection.drop() 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.46.92