nedb
nedb copied to clipboard
Added positional operator ($) support when updating documents.
Heavily inspired by the work of @mitsos1os, I needed this feature for a project but it was lost amongst a large set of commits and never pulled. Hopefully this fits the guidelines, let me know what you think.
@HowlingGuineapig I was planning to restructure my commits with the form required by the author but I was completely out of free time. I hope you get to add this feature in this good project!
Hi @HowlingGuineapig, will it work to change an object property inside an array of objects? Like in the example below:
db.update({ 'objects.anyIdentifier': 'id' }, { $set: { 'objects.$.anyProperty': 'newValue' } }, {}, function () { })
Hi @rodzero, yes that is exactly the sort of thing I made this pull request for, but I made a mistake when writing the README. I tried to make the entry look like all those around it and instead wrote an example that just doesn't work. I have fixed the README now with a working example that looks a bit more like yours. Thanks for pointing it out.
Merged into nedb3