Skip to content

RUBY-3611 Support $lookup in CSFLE/QE#3054

Open
jamis wants to merge 15 commits into
mongodb:masterfrom
jamis:3611-support-lookup-in-csfle-qe
Open

RUBY-3611 Support $lookup in CSFLE/QE#3054
jamis wants to merge 15 commits into
mongodb:masterfrom
jamis:3611-support-lookup-in-csfle-qe

Conversation

@jamis
Copy link
Copy Markdown
Contributor

@jamis jamis commented May 29, 2026

Adds support for $lookup with CSFLE and QE.

@jamis jamis marked this pull request as ready for review June 1, 2026 21:35
@jamis jamis requested a review from a team as a code owner June 1, 2026 21:35
@jamis jamis requested review from comandeo-mongo and Copilot June 1, 2026 21:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds driver + test support for running CSFLE/QE aggregation pipelines that include $lookup, which requires libmongocrypt to handle multiple collection schemas and (for some operations) to request collection info for a specific database.

Changes:

  • Enable/handle new libmongocrypt capabilities: multiple-collection collinfo, and the need_mongo_collinfo_with_db context state.
  • Update encryption I/O to return all matching collection info documents (not just the first) and feed each to libmongocrypt.
  • Add a new prose integration spec and supporting schema/key fixtures to validate $lookup behavior across CSFLE/QE/plain collections.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/support/spec_config.rb Grants test user privileges for the new collection_info_test database used by specs.
spec/support/crypt.rb Extracts shared extra_options builder into Crypt.extra_options and reuses it in shared FLE helpers.
spec/support/crypt/lookup/schema-qe2.json Adds QE2 encryptedFields fixture for $lookup prose test.
spec/support/crypt/lookup/schema-qe.json Adds QE encryptedFields fixture for $lookup prose test.
spec/support/crypt/lookup/schema-non-csfle.json Adds non-CSFLE JSON schema fixture for prose test case 10.
spec/support/crypt/lookup/schema-csfle2.json Adds CSFLE2 JSON schema fixture for prose test.
spec/support/crypt/lookup/schema-csfle.json Adds CSFLE JSON schema fixture for prose test.
spec/support/crypt/lookup/key-doc.json Adds data key fixture used by the $lookup prose test.
spec/mongo/crypt/handle_spec.rb Verifies the handle enables new libmongocrypt options.
spec/mongo/crypt/encryption_io_spec.rb Adds unit coverage ensuring collection_info returns arrays correctly.
spec/mongo/crypt/binding/mongocrypt_spec.rb Adds unit coverage for new binding option setters.
spec/mongo/crypt/binding/context_spec.rb Adds coverage for the new context-state enum value.
spec/integration/client_side_encryption/lookup_prose_spec.rb New prose integration spec validating $lookup behavior for CSFLE and QE.
lib/mongo/crypt/handle.rb Enables multiple collinfo and “collinfo-with-db” state handling on handle initialization.
lib/mongo/crypt/encryption_io.rb Changes collection_info to return all matching collection info documents.
lib/mongo/crypt/context.rb Adds support for the new :need_mongo_collinfo_with_db state and feeds multiple collinfo docs.
lib/mongo/crypt/binding.rb Extends ctx-state enum and binds new libmongocrypt APIs for $lookup support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/integration/client_side_encryption/lookup_prose_spec.rb Outdated
Comment thread lib/mongo/crypt/binding.rb
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.

2 participants