-
Notifications
You must be signed in to change notification settings - Fork 244
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
DRIVERS-2124: test that inserts and upserts respect null _id values #1699
Conversation
…d anchors, use flow syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with suggestion applied.
observeEvents: | ||
- commandStartedEvent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
observeEvents: | |
- commandStartedEvent |
Looks like you got rid of APM assertions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured the result of count is the source of truth now since we are able to use a BSON type query avoiding any comparison looseness surrounding null/undefined. But happy to add it back, just saying it was intentional to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
countDocuments
seems sufficient. APM assertions don't help if we have to worry about how some drivers represent null/undefined values.
arguments: {filter: *null_id_filter} | ||
expectResult: 1 | ||
|
||
- description: inserting _id with type undefined via insertOne |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I'm removing these tests in #1713 as the server prohibits undefined values for _id
.
Please complete the following before merging:
[ ] Update changelog.N/Aclusters, and serverless).
Description
Adds tests for null and undefined as
_id
values to check that drivers do not interpret these types as "unset" and generate an ObjectId and overwrite the value.