how to delete a record using mongojs
Question
I am using mongojs together with nodejs and express. From so many online documents I only found find()
save()
update()
methods. Is there a delete
api ? If so, how to use it?
I am trying to remove one record based on _id which is auto generated by mongdodb...
Any links and examples will be appreciated.
OTHER TIPS
db.collection.remove(query, [justOne], [callback])
you can read the docs for monogojs https://github.com/mafintosh/mongojs for example To remove a single document from inventory, call the remove() method with the justOne parameter set to true or 1(default). e.g
db.inventory.remove( { type : "food" }, callback)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow