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

Remove $setOnInsert from findOneAndUpdate #100

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

Conversation

alansikora
Copy link

I had to remove $setOnInsert from MongoClient because that would cause updates to never work.

As stated here: https://docs.mongodb.com/manual/reference/operator/update/setOnInsert/

If an update operation with upsert: true results in an insert of a document, then $setOnInsert assigns the specified values to the fields in the document. If the update operation does not result in an insert, $setOnInsert does nothing.

Am I missing something?

@alansikora alansikora changed the title Remove $setOnInsert Remove $setOnInsert from findOneAndUpdate Feb 20, 2017
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.

2 participants