Skip to content

feat(NODE-7537): promote QE string queries (prefix/suffix/substring)#4996

Merged
PavelSafronov merged 2 commits into
mainfrom
feat/NODE-7537-qe-string-substring-ga
Jul 7, 2026
Merged

feat(NODE-7537): promote QE string queries (prefix/suffix/substring)#4996
PavelSafronov merged 2 commits into
mainfrom
feat/NODE-7537-qe-string-substring-ga

Conversation

@tadjik1

@tadjik1 tadjik1 commented Jul 7, 2026

Copy link
Copy Markdown
Member

Description

Summary of Changes

Promotes Queryable Encryption string queries from Technical Preview. The TextPreview algorithm becomes String and TextOpts becomes StringOpts, the prefix, suffix, and substring query types are promoted, and their *Preview counterparts are deprecated. This consolidates the closely-coupled work that all touches the same prose and unified spec tests and requires mongodb-client-encryption 7.2.0 (libmongocrypt 1.20.0), which is now released: the API rename and prefix/suffix promotion (NODE-7537), the substring query type (NODE-7654), the fle2v2-InsertFind-keyAltName test sync (NODE-7433), the $lookup prose test 25 update (NODE-7221), the case/diacritic regression prose tests (NODE-7578), and skipping substringPreview on server 9.0+ (NODE-7641). Aside from the client_encryption API changes and the dependency bump, this is spec test sync.

Notes for Reviewers

Every vendored spec test file is synced byte-for-byte with the specifications repo. Preview query types remain available but are skipped on server 9.0+ via maxServerVersion in the unified tests and version-gated prose metadata. Supersedes the stacked PRs #4972 and #4993, and the case/diacritic PR #4983.

Release Highlight

Queryable Encryption string queries are now generally available

Queryable Encryption string queries are now generally available for MongoDB 9.0. Building on the technical preview introduced in earlier releases, this feature lets you run exact and range-style string matching against encrypted fields. As part of the promotion to GA, the API has been renamed:

  • The TextOpts API is replaced with StringOpts.
  • The TextPreview algorithm is replaced with String.
  • The prefix, suffix, and substring query types are now generally available.
  • The prefixPreview, suffixPreview, and substringPreview query types remain deprecated and will be removed in a future release.

Double check the following

  • Lint is passing (npm run check:lint)
  • 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

@tadjik1 tadjik1 force-pushed the feat/NODE-7537-qe-string-substring-ga branch 2 times, most recently from fc02bf2 to 36b7fd1 Compare July 7, 2026 11:46
@tadjik1 tadjik1 marked this pull request as ready for review July 7, 2026 12:19
@tadjik1 tadjik1 requested a review from a team as a code owner July 7, 2026 12:19
Copilot AI review requested due to automatic review settings July 7, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR promotes Queryable Encryption string queries (prefix/suffix/substring) from Technical Preview to GA for MongoDB 9.0+, renaming the public API surface from TextPreview/TextOpts to String/StringOpts while keeping the *Preview variants deprecated for pre-9.0 servers. Most of the change is a byte-for-byte spec test sync plus a required mongodb-client-encryption dependency bump.

Changes:

  • Promote QE string query types (prefix/suffix/substring) and add GA unified tests gated to server 9.0+; keep preview unified tests gated to server <9.0.
  • Update Node driver explicit encryption API types to add 'String' algorithm and stringOptions, while deprecating TextPreview and textOptions.
  • Bump mongodb-client-encryption to ^7.2.0 and update prose tests/fixtures to align with the GA behavior and new error-message expectations.

Reviewed changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/spec/client-side-encryption/tests/unified/QE-Text-suffixPreview.yml Vendored unified test: raise libmongocrypt floor and fix suffix test description.
test/spec/client-side-encryption/tests/unified/QE-Text-suffixPreview.json Vendored unified test JSON equivalent updates.
test/spec/client-side-encryption/tests/unified/QE-Text-suffix.yml New vendored unified test for GA suffix on server 9.0+.
test/spec/client-side-encryption/tests/unified/QE-Text-suffix.json New vendored unified test JSON equivalent for GA suffix.
test/spec/client-side-encryption/tests/unified/QE-Text-substringPreview.yml Vendored unified test: gate preview to server <9.0 and adjust substring parameters/expectations.
test/spec/client-side-encryption/tests/unified/QE-Text-substringPreview.json Vendored unified test JSON equivalent updates.
test/spec/client-side-encryption/tests/unified/QE-Text-substring.yml New vendored unified test for GA substring on server 9.0+.
test/spec/client-side-encryption/tests/unified/QE-Text-substring.json New vendored unified test JSON equivalent for GA substring.
test/spec/client-side-encryption/tests/unified/QE-Text-prefixPreview.yml Vendored unified test: raise libmongocrypt floor for preview prefix.
test/spec/client-side-encryption/tests/unified/QE-Text-prefixPreview.json Vendored unified test JSON equivalent updates.
test/spec/client-side-encryption/tests/unified/QE-Text-prefix.yml New vendored unified test for GA prefix on server 9.0+.
test/spec/client-side-encryption/tests/unified/QE-Text-prefix.json New vendored unified test JSON equivalent for GA prefix.
test/spec/client-side-encryption/tests/unified/QE-Text-compactStructuredEncryptionData.yml Vendored unified test: switch from preview to GA suffix, adjust server/libmongocrypt gating.
test/spec/client-side-encryption/tests/unified/QE-Text-compactStructuredEncryptionData.json Vendored unified test JSON equivalent updates.
test/spec/client-side-encryption/tests/unified/QE-Text-cleanupStructuredEncryptionData.yml Vendored unified test: switch from preview to GA suffix, adjust server/libmongocrypt gating.
test/spec/client-side-encryption/tests/unified/QE-Text-cleanupStructuredEncryptionData.json Vendored unified test JSON equivalent updates.
test/spec/client-side-encryption/tests/unified/fle2v2-InsertFind-keyAltName.yml New vendored unified test covering keyAltName translation behavior.
test/spec/client-side-encryption/tests/unified/fle2v2-InsertFind-keyAltName.json New vendored unified test JSON equivalent for keyAltName translation.
test/spec/client-side-encryption/etc/data/lookup/schema-non-csfle.json New spec fixture used by $lookup prose test case additions.
test/spec/client-side-encryption/etc/data/encryptedFields-substring.json Update encryptedFields fixture to use GA substring and updated query parameters.
test/spec/client-side-encryption/etc/data/encryptedFields-substring-preview.json New encryptedFields fixture for preview substringPreview.
test/spec/client-side-encryption/etc/data/encryptedFields-substring-ci-di.json New encryptedFields fixture for case/diacritic-insensitive substring.
test/spec/client-side-encryption/etc/data/encryptedFields-prefix-suffix.json Update encryptedFields fixture to use GA prefix/suffix and add contention.
test/spec/client-side-encryption/etc/data/encryptedFields-prefix-suffix-preview.json New encryptedFields fixture for preview prefixPreview/suffixPreview.
test/spec/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json New encryptedFields fixture for case/diacritic-insensitive prefix/suffix.
test/integration/client-side-encryption/client_side_encryption.prose.27.text_queries.test.ts Prose test implementation updated for GA string queries + new regression cases and preview gating.
test/integration/client-side-encryption/client_side_encryption.prose.25.lookup.test.ts Prose test updated for new $lookup case and broadened Case 8 error expectation.
src/index.ts Export new public type StringQueryOptions.
src/client-side-encryption/client_encryption.ts Add String algorithm + stringOptions, deprecate TextPreview + textOptions, and map string/text options for crypt context.
package.json Bump mongodb-client-encryption dependency/devDependency to ^7.2.0.
package-lock.json Lockfile updates for mongodb-client-encryption 7.2.0 and transitive deps.

Comment thread src/client-side-encryption/client_encryption.ts Outdated
@johnmtll johnmtll added the tracked-in-jira Ticket filed in MongoDB's Jira system label Jul 7, 2026
Promote Queryable Encryption string queries from Technical Preview.
Bundles the closely-coupled tickets that touch the same prose/unified
spec tests and require mongodb-client-encryption 7.2.0 (libmongocrypt
1.20.0):

- NODE-7537: rename `TextPreview` algorithm to `String` and `TextOpts`
  to `StringOpts`; promote `prefix`/`suffix` query types; `@deprecated`
  the old `TextPreview`/`prefixPreview`/`suffixPreview` names
- NODE-7654: add `substring` query type, `@deprecated` `substringPreview`
- NODE-7433: sync `fle2v2-InsertFind-keyAltName` unified spec test
- NODE-7221: update $lookup prose test 25 (Case 8 error message for
  server 8.2+ per MONGOCRYPT-793, add Case 10)
- NODE-7578: add prose test 27 Cases 8-11 (case/diacritic regression,
  DRIVERS-3470) and the `*-ci-di` encryptedFields data
- NODE-7641: skip `substringPreview` on server 9.0+ (DRIVERS-3555)

Also bumps mongodb-client-encryption to ^7.2.0. All vendored spec test
files are synced byte-for-byte with the specifications repo.

Preview query types remain available but are skipped on server 9.0+ via
`maxServerVersion` in the unified tests and version-gated prose metadata.
@tadjik1 tadjik1 force-pushed the feat/NODE-7537-qe-string-substring-ga branch from 36b7fd1 to 0e45a7f Compare July 7, 2026 13:52
PavelSafronov
PavelSafronov previously approved these changes Jul 7, 2026

@PavelSafronov PavelSafronov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

Comment thread src/client-side-encryption/client_encryption.ts
@PavelSafronov PavelSafronov self-assigned this Jul 7, 2026
Addresses review feedback on #4996: guard the stringOptions ?? textOptions
fallback so a future change can't silently break backward compat.
@PavelSafronov PavelSafronov merged commit dc4900c into main Jul 7, 2026
15 of 16 checks passed
@PavelSafronov PavelSafronov deleted the feat/NODE-7537-qe-string-substring-ga branch July 7, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tracked-in-jira Ticket filed in MongoDB's Jira system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants