Closed jsainzvela closed 5 years ago
Oh right, ok, I'll look into it and see what the difference is and whether I should be using the other. :) Many thanks for pointing it out!
Not a prob Andrew, we are just developing something similar (in both Pyton and Perl) and run into the same problem, so I was looking for a "reference implementation".
Thanks!
Jorge
On 3/9/16 7:17, Andrew Chilton wrote:
Oh right, ok, I'll look into it and see what the difference is and whether I should be using the other. :) Many thanks for pointing it out!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chilts/mongodb-queue/issues/13#issuecomment-244527544, or mute the thread https://github.com/notifications/unsubscribe-auth/ALqx5EraPDiF5KZ4p7NMKuArSmmT6Uc9ks5qmQMGgaJpZM4Jzpr-.
I think the code is new functions from the 3.x MongoDB series such as findOneAndUpdate
, and the findAndUpdate
is deprecated. There was a PR with this information in here from @hanwencheng:
So yeah, I think the docs are wrong there. I'll update them (or in fact, probably remove it and just say it's atomic, so we don't get conflicting info again). :)
Thanks for raising this and sorry it's taken me so long to look into it!
No prob @chilts, thanks to you!
I'll just leave open to remind me to do the docs. :) Thanks.
v4.0.0 was released around 7 months ago and now uses MongoDB v3 driver and should be all up to date now.
Hi,
just a clarification. I see you claim to use the findAndModify operation as the basis of the .get() method of your module, but when I dig into the code I just see the following line:
self.col.findOneAndUpdate(query, update, { sort: sort, returnOriginal : false }, function(err, result)
Are those the same operations internally? They are supposed to be different:
https://docs.mongodb.com/manual/reference/command/findAndModify/ https://docs.mongodb.com/manual/reference/method/db.collection.findOneAndUpdate/
Thanks a lot in advance!
Jorge