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(NODE-5126): find operations fail when passed an ObjectId as filter #3604

Merged
merged 5 commits into from
Mar 28, 2023
Merged

fix(NODE-5126): find operations fail when passed an ObjectId as filter #3604

merged 5 commits into from
Mar 28, 2023

Conversation

JoCat
Copy link
Contributor

@JoCat JoCat commented Mar 16, 2023

Description

What is changing?

This PR fixes an error related to the definition of the ObjectId passed to the filter.

Is there new documentation needed for these changes?

no

What is the motivation for this change?

It seems that after merge PR #3490 the value of _bsontype for ObjectId has changed.
Before update 5.0 "ObjectId._bsontype" is defined as "ObjectID", after "ObjectId".
Because of this, passing it in functions such as findOne() causes an error.

image
image
image

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken changed the title fix: passing of ObjectId as a filter fix(NODE-5126): passing of ObjectId as a filter Mar 16, 2023
@nbbeeken nbbeeken added External Submission PR submitted from outside the team tracked-in-jira Ticket filed in MongoDB's Jira system labels Mar 16, 2023
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 27, 2023
@nbbeeken nbbeeken self-assigned this Mar 27, 2023
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

Thanks for bringing this to our attention and providing a fix @JoCat! I've just added some tests I'll get my colleagues to look at and we can move this along

@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Mar 27, 2023
@W-A-James W-A-James self-requested a review March 27, 2023 19:23
Copy link
Contributor

@W-A-James W-A-James left a comment

Choose a reason for hiding this comment

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

Just a few small changes

test/integration/crud/find.test.js Outdated Show resolved Hide resolved
test/integration/crud/find_and_modify.test.js Outdated Show resolved Hide resolved
test/integration/gridfs/gridfs.test.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken requested a review from W-A-James March 27, 2023 19:54
test/integration/crud/find.test.js Outdated Show resolved Hide resolved
test/integration/crud/find.test.js Outdated Show resolved Hide resolved
test/integration/crud/find.test.js Outdated Show resolved Hide resolved
test/integration/gridfs/gridfs.test.ts Outdated Show resolved Hide resolved
test/integration/gridfs/gridfs.test.ts Outdated Show resolved Hide resolved
test/integration/crud/find.test.js Outdated Show resolved Hide resolved
@nbbeeken nbbeeken requested a review from W-A-James March 27, 2023 20:10
Copy link
Contributor

@W-A-James W-A-James left a comment

Choose a reason for hiding this comment

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

LGTM

@W-A-James W-A-James assigned W-A-James and unassigned nbbeeken Mar 28, 2023
@W-A-James W-A-James changed the title fix(NODE-5126): passing of ObjectId as a filter fix(NODE-5126): find operations fail when passed an ObjectId as filter Mar 28, 2023
@W-A-James W-A-James merged commit 2647b61 into mongodb:main Mar 28, 2023
@JoCat JoCat deleted the patch-1 branch April 3, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Submission PR submitted from outside the team Team Review Needs review from team tracked-in-jira Ticket filed in MongoDB's Jira system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants