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-4634): add support for bulk FindOperators.hint() #3408

Merged
merged 4 commits into from Sep 15, 2022

Conversation

addaleax
Copy link
Contributor

Description

What is changing?

  • FindOperators.update() and .updateOne() use updated TS definitions to allow pipeline-style updates (which are supported by the server and by the actual implementation itself)
  • FindOperators.hint() is added as an analogue to the .collation(), .arrayHints() and .upsert() methods
  • Tests for both of the above are added, modeled on existing tests
Is there new documentation needed for these changes?

I would assume so.

What is the motivation for this change?

mongosh cannot implement .hint() in its own bulk write builder API without one of:

  • Modifying driver internals, or
  • Implementing the entire bulk builder API itself on top of collection.bulkWrite(), or
  • This change

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>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

… and fix `.update()`/`.updateOne()` to also accept pipeline-style
updates as other update APIs do as well.
test/integration/crud/bulk.test.ts Outdated Show resolved Hide resolved
test/integration/crud/bulk.test.ts Outdated Show resolved Hide resolved
test/integration/crud/bulk.test.ts Outdated Show resolved Hide resolved
src/bulk/common.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Sep 13, 2022
@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 Sep 13, 2022
@nbbeeken nbbeeken merged commit 8758890 into mongodb:main Sep 15, 2022
@addaleax addaleax deleted the 4634-dev branch September 16, 2022 13:48
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
3 participants