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

Creating a new document with an _id field fails #44

Closed
johnoliver opened this issue Sep 24, 2015 · 2 comments
Closed

Creating a new document with an _id field fails #44

johnoliver opened this issue Sep 24, 2015 · 2 comments
Assignees
Labels
bug
Milestone

Comments

@johnoliver
Copy link
Contributor

@johnoliver johnoliver commented Sep 24, 2015

The current logic of saveWithOptions, says that if the document to save has an _id then the query gets changed to a "replaceOne", if the db then does not have an existing entry with that _id no document will be saved.

@karianna

This comment has been minimized.

Copy link
Contributor

@karianna karianna commented Sep 25, 2015

That begs the question, what should the logic say?

@johnoliver

This comment has been minimized.

Copy link
Contributor Author

@johnoliver johnoliver commented Sep 25, 2015

willing to bet passing new UpdateOptions().upsert(true) to replaceOne would do the trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.