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-6773): add multiple collinfo option #70

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nbbeeken
Copy link
Collaborator

@nbbeeken nbbeeken commented Feb 19, 2025

Description

What is changing?

In support of: mongodb/node-mongodb-native#4427

Is there new documentation needed for these changes?

What is the motivation for this change?

Release Highlight

Enables multiple collection info support for $lookup aggregations

Calls mongocrypt_setopt_enable_multiple_collinfo to enable the setting

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

@@ -577,6 +577,8 @@ MongoCrypt::MongoCrypt(const CallbackInfo& info) : ObjectWrap(info) {

mongocrypt_setopt_retry_kms(mongo_crypt(), true);

mongocrypt_setopt_enable_multiple_collinfo(mongo_crypt());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: The driver may need a way to know if this is set

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This shouldn't be necessary, only an updated libmongocrypt will request more than one collInfo

Copy link
Collaborator

@baileympearson baileympearson Feb 21, 2025

Choose a reason for hiding this comment

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

Isn't the issue when an updated libmongocrypt interacts with a driver that isn't updated though (i.e., driver pre 6.14)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, unfortunately having moved the JS code for the bindings into the driver means that that's a case we now need to handle – this option would have to be passed from JS to the constructor instead of being set unconditionally

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a new option to control this, not sure how I would test this here since you can't inspect the properties of the struct (of course) and there doesn't seem to be a getopt API.

We can flip the option in the driver, and your $lookups fail as a result.

addaleax
addaleax previously approved these changes Feb 20, 2025
@nbbeeken nbbeeken marked this pull request as ready for review February 21, 2025 15:48
@nbbeeken nbbeeken requested a review from a team as a code owner February 21, 2025 15:48
@addaleax addaleax dismissed their stale review February 21, 2025 16:18

See Bailey's comment

@nbbeeken nbbeeken changed the title feat(NODE-6773): enable multiple collinfo option feat(NODE-6773): add multiple collinfo option Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants