As far as I can say,
db.collection.deleteMany
Returns:
A document containing:
> A boolean acknowledged as true if the operation ran with write concern or false if write concern was disabled
> deletedCount containing the number of deleted documents
REF: db.collection.deleteMany
Where as
db.collection.remove
return WriteResult
And to remove a single document, there a similar command, db.collection.removeOne
where as with db.collection.remove
you need to set and option called justOne
option to limit delete to 1 document.
Otherwise I guess they are similar.
node.js drivers
When talking about node.js drivers
, remove
has been deprecated (and may be removed in future releases) and deleteOne
or deleteMany
.
Hope this makes sense ....
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…