Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added positional operator ($) support when updating documents. #438

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HowlingGuineapig
Copy link

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.

Heavily inspired by the work of github user mitsos1os.
@mitsos1os
Copy link
Contributor

@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!

@rozamirandar
Copy link

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 () {
})

@HowlingGuineapig
Copy link
Author

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.

@pi0
Copy link

pi0 commented Nov 30, 2016

Merged into nedb3

Copy link

@fwiwDev fwiwDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow ! That is exactly what I need... thank you

SReject added a commit to SReject/nedb that referenced this pull request Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants