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

feat!(NODE-4704): remove deprecated ObjectId methods #525

Merged
merged 5 commits into from
Nov 30, 2022

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Nov 22, 2022

Description

What is changing?

Removing deprecated ObjectId methods.

What is the motivation for this change?

Methods are deprecated, alternatives exist.

Double check the following

  • Ran npm run lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken marked this pull request as ready for review November 23, 2022 16:28
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Nov 23, 2022
@nbbeeken nbbeeken requested a review from durran November 23, 2022 16:29
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

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

Just minor test description changes per our test patterns.

test/node/object_id_tests.js Outdated Show resolved Hide resolved
test/node/object_id_tests.js Outdated Show resolved Hide resolved
test/node/object_id_tests.js Outdated Show resolved Hide resolved
durran
durran previously approved these changes Nov 23, 2022
@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Nov 23, 2022
docs/upgrade-to-v5.md Outdated Show resolved Hide resolved
docs/upgrade-to-v5.md Outdated Show resolved Hide resolved

```ts
const oid = new ObjectId();
const counterField = oid.id[9] << 16 | oid.id[10] << 8 | oid.id[11];
Copy link
Contributor

Choose a reason for hiding this comment

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

completely optional - should we consider just adding a simple getter that does this for users?

  getCounter() : number { return this.id[9] << 16 | this.id[10] << 8 | this.id[11]; }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nbbeeken nbbeeken force-pushed the NODE-4704-remove-deprecated-oid-methods branch from 68eefb0 to d24d275 Compare November 29, 2022 21:21
baileympearson
baileympearson previously approved these changes Nov 30, 2022
Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

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

in the spirit of the spec, I think we shouldn't include the instructions for obtaining the counter (especially if we ever want to change the internal implementation); otherwise lgtm

dariakp
dariakp previously approved these changes Nov 30, 2022
@baileympearson baileympearson merged commit f1cccf2 into main Nov 30, 2022
@baileympearson baileympearson deleted the NODE-4704-remove-deprecated-oid-methods branch November 30, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants