-
Couldn't load subscription status.
- Fork 533
RUBY-3355 - Create when key '_id' (as string) is nil results in error #2808
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
RUBY-3355 - Create when key '_id' (as string) is nil results in error #2808
Conversation
...wo different _id keys in the document
Thank you! I've added a Jira ticket here (https://jira.mongodb.org/browse/RUBY-3355) to track this. Thank you for finding this, and for the pull request!
tom-selander
commented
Nov 20, 2023
Hi @DrissTM thanks for filing this PR. We have tagged this for consideration next quarter and have backlogged the associated Jira ticket until then. Please follow/watch https://jira.mongodb.org/browse/RUBY-3355 for updates.
Hi!
While investigating an issue in an application I'm working on I discovered that trying to insert a document containing
'_id' => nilwill raise the following exception:Here's a reproduction script:
I was able to track down the issue in the
lib/mongo/operation/shared/idable.rbfile:When
'_id'is equal tonilhas_id?returnsfalsewhich causesensure_idsto generate an id that it stores in:_idbut without removing the'_id'key which results in the document having both'_id'and:_id, hence the exception mentioned above.Let me know if I should create an issue in JIRA first