Open royaltm opened 8 years ago
do you consider accepting pull requests? didn't find anything about contribution
Sorry for not getting back to you sooner on this.
To answer your question, yes, I do accept pull requests (I'll update the README to better reflect this). Do you have one ready? If not, I should be able to get to this feature within the next few days.
Thanks!
I see this being listed for milestone 0.13.0 Are you planning to release 0.13.0 in the near future?
I'm using 0.12.3 and I have the following query executed Stats.findOneAndUpdate({'myid': myID},{$push: {'stats': stats } },{upsert: false, new: true})
and I keep getting the error message name: 'MongoError', message: 'exception: The dollar ($) prefixed field \'$push\' in \'$push\' is not valid for storage.',
Is the error because of the feature being not available in 0.12.3?
Currently there is no easy way to make use of those atomic updates to underlying documents. Perhaps it would be easy to enhance Document.prototype.loadOneAndUpdate in such a way:
MyDoc.loadOneAndUpdate(query, {somePropToIncrement: 2}, {update: "inc"})
so the client implementation would be such like: