Reputation: 161
Good morning.
I'm working on a back-end project, and I use NodeJS with mongoose.
I found two different return values for deleteOne() on the web :
Here are the sources : https://kb.objectrocket.com/mongo-db/mongoose-deleteone-922 https://www.mongodb.com/docs/manual/reference/method/db.collection.deleteOne/#examples
In my project, I had a return value equal to {acknowledged: true, deletedCount: 1} and I could not find a way to reproduce the {n, ok, deletedCount}.
What is the difference between the two patterns ?
Thanks in advance !
Elias.
Upvotes: 0
Views: 141
Reputation: 738
I would think this has something to do with the version of the MongoDB
. The first example is a forum post from 3 years
ago and the second example is the newest docs.
Upvotes: 1