Closed DonaldDu closed 8 years ago
@DonaldDu thanks! Were you able to come up with a fix? Would love you to contribute it.
I'm a bit baffled why save souldn't work any more, I haven't changed the code in a long time. Do you have a sample script I could run to see what is happening?
BTW, given problems I've had with MongoDB, I'm building a better database - you should check it out: github.com/amark/gun . It has realtime sync (think like an Open Source Firebase) and all sorts of cool stuff.
currently: mongous.prototype.save = function(a) { return this.update(a, a, 1); }; if new just create one. else something updated. there can't be one match the updated for all fileds in the database. but the _id already existed, create new one failed.
Sorry, I had a baby and then got distracted with holidays and a ton of work. Now just went back through emails and saw this.
I'm not sure I understand your previous message. I would still need a script I can run to replicate the problem as well as what version of MongoDB you are on.
I'm going to close this issue since it has been a while, feel free to open/comment it again though with the above info.
currently: mongous.prototype.save = function(a) { return this.update(a, a, 1); }; I think shoud be so, I tested. mongous.prototype.save = function(a) { return this.update({a._id}, a, true); };