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

Fix #433: allow _id with $setOnInsert #434

Merged
merged 3 commits into from
May 22, 2023

Conversation

tatu-at-datastax
Copy link
Contributor

What this PR does:

Allows specifying _id with $setOnInsert (currently leads to failure)

Which issue(s) this PR fixes:
Fixes #433

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this May 19, 2023
@tatu-at-datastax
Copy link
Contributor Author

Added tests for 3 commands -- findOneAndUpdate, updateOne, updateMany -- since I don't think findOneAndReplace takes update document (as per https://www.mongodb.com/docs/mongodb-shell/crud/update/ ). I think this covers all cases.

@tatu-at-datastax tatu-at-datastax changed the title (WIP) Fix #433: allow _id with $setOnInsert Fix #433: allow _id with $setOnInsert May 19, 2023
@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review May 19, 2023 18:06
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner May 19, 2023 18:06
Copy link
Contributor

@maheshrajamani maheshrajamani left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@tatu-at-datastax tatu-at-datastax merged commit e7fde07 into main May 22, 2023
@tatu-at-datastax tatu-at-datastax deleted the tatu/433-allow-id-on-setoninsert branch May 22, 2023 14:01
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.

Support '_id' in '$setOnInsert'
3 participants