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

Returning associated "_id" value from update functions. #17

Open
Palmik opened this issue Feb 14, 2012 · 1 comment
Open

Returning associated "_id" value from update functions. #17

Palmik opened this issue Feb 14, 2012 · 1 comment

Comments

@Palmik
Copy link

Palmik commented Feb 14, 2012

Hello,
I wanted to ask if there is an inherent reason for not having update functions (like save) return the updated document's value in the "_id" field (or the one automatically created). After looking at the code, it did not seem like an impossible task, but I might have overlooked something. Or perhaps it's deliberate design decision?

@TonyGen
Copy link
Owner

TonyGen commented Feb 20, 2012

Hi Petr, update operation in general does require an _id, although it would make sense for Save and Repsert. It could make sense for Replace but Replace can also be given a Modifier instead of a Document. Ie. Replace is the same as Modify except it only modifies the first matching document in collection. Please provide a pull request if you really want this. Cheers, Tony

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

No branches or pull requests

2 participants