MongoDB Delete Document
The db.collection.remove() method will remove the document or
documents from the collection. It’s syntax is as follows
Syntax:
db.collection.remove( <query>, <justOne>)
if justOne: set to true limits removal of documents to justOne instead of all if multiple records matched for the query
Example:-
Remove a single document having
userid “Andrew”
>db.users.remove({userid:”Andrew”,justOne:true})
Remove all users having Age >25
>db.users.remove({Age:{$gt:25}})
Remove all records of 'users'
collection
>db.users.remove({})