feat(NODE-7537): promote QE string queries (prefix/suffix/substring)#4996
Merged
Conversation
This was referenced Jul 7, 2026
fc02bf2 to
36b7fd1
Compare
Contributor
There was a problem hiding this comment.
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 andstringOptions, while deprecatingTextPreviewandtextOptions. - Bump
mongodb-client-encryptionto^7.2.0and 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. |
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.
36b7fd1 to
0e45a7f
Compare
PavelSafronov
previously approved these changes
Jul 7, 2026
Addresses review feedback on #4996: guard the stringOptions ?? textOptions fallback so a future change can't silently break backward compat.
PavelSafronov
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of Changes
Promotes Queryable Encryption string queries from Technical Preview. The
TextPreviewalgorithm becomesStringandTextOptsbecomesStringOpts, theprefix,suffix, andsubstringquery types are promoted, and their*Previewcounterparts 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), thefle2v2-InsertFind-keyAltNametest sync (NODE-7433), the$lookupprose test 25 update (NODE-7221), the case/diacritic regression prose tests (NODE-7578), and skippingsubstringPreviewon 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
maxServerVersionin 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:
TextOptsAPI is replaced withStringOpts.TextPreviewalgorithm is replaced withString.prefix,suffix, andsubstringquery types are now generally available.prefixPreview,suffixPreview, andsubstringPreviewquery types remain deprecated and will be removed in a future release.Double check the following
npm run check:lint)type(NODE-xxxx)[!]: description