robbiblubber.org

help | login | search:  
>>

show wiki  show source  compare to current  compare to previous  read  history 


delete()


MongoDB Driver Function Reference

delete() deletes documents from a collection.



db.<collection>.delete(<filter>[, <options>])



Arguments


<collection> The target collection
<filter> A filter expression using query operators
<options> A BOSN document specifying options



Options


{ collation: <document>, hint: <document> }

collation A document specifying the collation
hint A document specifying a hint



Example


db.employees.delete({ salary: { $gt: 700000 }});


Deletes all documents from the employee collection with a salary greater than 700000.




home | MongoDB Driver Function Reference | MongoDB Driver