Skip to content

Default to '' all update data in findAndModify if doesn't contain a key operator #48

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

Closed

Conversation

DerManoMann
Copy link
Contributor

If the $update map for findAndUpdate does not contain an operator (for example '$set'), the expected behaviour is to treat it like ['$set' => $update]

Not sure if this is actually documented, but I do have to deal with code that uses this "feature" quite a bit...

@alcaeus
Copy link
Owner

alcaeus commented Feb 4, 2016

Thanks! I merged this one into #28 as there is a different behavior: when not using update operators, the behavior is essentially the same as with findOneAndReplace, not just updating the fields given in the document. I've adjusted the test and code to account for this.

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.

3 participants