What's the difference between "deletemany" and "remove" in mongodb? -
what's difference between 2 commands here?
db.collection.deletemany({condition})
db.collection.remove({condition})
as far can say,
db.collection.deletemany
returns: document containing: > boolean acknowledged true if operation ran write concern or false if write concern disabled > deletedcount containing number of deleted documents
where as
db.collection.remove
return writeresult
and remove single document, there similar command, db.collection.removeone
db.collection.remove
need set , option called justone
option limit delete 1 document.
otherwise guess similar.
node.js drivers
when talking node.js drivers
, remove
has been deprecated (and may removed in future releases) , deleteone
or deletemany
.
hope makes sense ....
Comments
Post a Comment