Skip to content

GODRIVER-3540 Support Prefix/Suffix/Substring Indexes.#2267

Merged
qingyang-hu merged 10 commits intomongodb:masterfrom
qingyang-hu:godriver3540
Jan 22, 2026
Merged

GODRIVER-3540 Support Prefix/Suffix/Substring Indexes.#2267
qingyang-hu merged 10 commits intomongodb:masterfrom
qingyang-hu:godriver3540

Conversation

@qingyang-hu
Copy link
Contributor

@qingyang-hu qingyang-hu commented Dec 10, 2025

GODRIVER-3540

Summary

  • Add Prefix/Suffix/Substring Indexes. (dea5746)
  • Add a new task for client side encryption prose tests. (915f59e)

Background & Motivation

@mongodb-drivers-pr-bot
Copy link
Contributor

mongodb-drivers-pr-bot bot commented Dec 10, 2025

🧪 Performance Results

Commit SHA: ad308ae

The following benchmark tests for version 69723ef0f9613000074bce90 had statistically significant changes (i.e., |z-score| > 1.96):

Benchmark Measurement % Change Patch Value Stable Region H-Score Z-Score
BenchmarkSmallDocInsertOne ops_per_second_min -87.3019 180.2191 Avg: 1419.2619
Med: 1457.7196
Stdev: 230.0747
0.8990 -5.3854

For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch.

@mongodb-drivers-pr-bot
Copy link
Contributor

mongodb-drivers-pr-bot bot commented Dec 10, 2025

API Change Report

./v2/mongo/options

compatible changes

(*EncryptOptionsBuilder).SetTextOptions: added
EncryptOptions.TextOptions: added
PrefixOptions: added
SubstringOptions: added
SuffixOptions: added
Text: added
TextOptions: added
TextOptionsBuilder: added

./v2/x/mongo/driver/mongocrypt/options

compatible changes

(*ExplicitEncryptionOptions).SetAlgorithm: added
(*ExplicitEncryptionOptions).SetContentionFactor: added
(*ExplicitEncryptionOptions).SetKeyAltName: added
(*ExplicitEncryptionOptions).SetKeyID: added
(*ExplicitEncryptionOptions).SetQueryType: added
(*ExplicitEncryptionOptions).SetRangeOptions: added
(*ExplicitEncryptionOptions).SetTextOptions: added
ExplicitEncryption: added
ExplicitEncryptionOptions.TextOptions: added
ExplicitTextOptions: added
PrefixOptions: added
SubstringOptions: added
SuffixOptions: added

@github-actions github-actions bot added the review-priority-normal Medium Priority PR for Review: within 1 business day label Dec 12, 2025
@qingyang-hu qingyang-hu force-pushed the godriver3540 branch 18 times, most recently from 07ccbf6 to 78de09d Compare December 19, 2025 20:30
Comment on lines -505 to -519
run-kms-tls-test:
- command: subprocess.exec
params:
binary: "bash"
env:
GO_BUILD_TAGS: cse
include_expansions_in_env: [AUTH, SSL, MONGODB_URI, TOPOLOGY, MONGO_GO_DRIVER_COMPRESSOR]
args: [*task-runner, setup-test]
- command: subprocess.exec
type: test
retry_on_failure: true
params:
binary: "bash"
include_expansions_in_env: [KMS_TLS_TESTCASE]
args: [*task-runner, evg-test-kms]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merged into run-client-side-encryption-test.

Comment on lines -1411 to -1440
- name: "test-kms-tls-invalid-cert"
tags: ["kms-test"]
commands:
- func: bootstrap-mongo-orchestration
vars:
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
- func: start-cse-servers
- func: run-kms-tls-test
vars:
KMS_TLS_TESTCASE: "INVALID_CERT"
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
- name: "test-kms-tls-invalid-hostname"
tags: ["kms-test"]
commands:
- func: bootstrap-mongo-orchestration
vars:
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
- func: start-cse-servers
- func: run-kms-tls-test
vars:
KMS_TLS_TESTCASE: "INVALID_HOSTNAME"
TOPOLOGY: "server"
AUTH: "noauth"
SSL: "nossl"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merged into run-client-side-encryption-test.

Comment on lines -24 to -27
assume-test-secrets-ec2-role:
- command: ec2.assume_role
params:
role_arn: ${aws_test_secrets_role}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A duplicate of L565.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied from "specifications/source/client-side-encryption/etc/data/encryptedFields-prefix-suffix.json"

@qingyang-hu qingyang-hu marked this pull request as ready for review December 19, 2025 21:38
Copilot AI review requested due to automatic review settings December 19, 2025 21:38
@qingyang-hu qingyang-hu requested a review from a team as a code owner December 19, 2025 21:38
SetKmsProviders(fullKmsProvidersMap).
SetKeyVaultNamespace(kvNamespace))
mt.Run(
"1. custom key material test",
Copy link
Member

Choose a reason for hiding this comment

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

[blocking] Since all of these subtests are single use and because it's probably not realistic to parametarize, I think we should use the mtest.Setup API added in GODRIVER-3663:

func newCSE_T(t *testing.T) *mtest.T {
    t.Helper()

	verifyClientSideEncryptionVarsSet(t)
	mt := mtest.New(t, mtest.NewOptions().MinServerVersion("4.2").Enterprise(true).CreateClient(false))

	defaultKvClientOptions := options.Client().ApplyURI(mtest.ClusterURI())
	integtest.AddTestServerAPIVersion(defaultKvClientOptions)
}

func TestClientSideEncryptionProse_CustomKeyMaterial(t *testing.T) {
	t.Parallel()

	mt := newCSE_T()
    mt.Setup()
    
    // logic

}

func TestClientSideEncryptionProse_DataKeyAndDoubleEncryption(t *testing.T) {
	t.Parallel()

	mt := newCSE_T()
    mt.Setup()
    
    // logic

}

What are your thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My only concern is that we will lose the top level t.Parallel() here in this way.


// TextOptions specifies index options for a Queryable Encryption field supporting "text" queries.
//
// See corresponding setter methods for documentation.
Copy link
Member

Choose a reason for hiding this comment

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

[nit] Can we separate the "Beta" note with an empty line?

Suggested change
// See corresponding setter methods for documentation.
// See corresponding setter methods for documentation.
//

matthewdale
matthewdale previously approved these changes Jan 14, 2026
@qingyang-hu qingyang-hu added review-priority-urgent High Priority PR for Review: review immediately! and removed review-priority-normal Medium Priority PR for Review: within 1 business day labels Jan 16, 2026
prestonvasquez
prestonvasquez previously approved these changes Jan 16, 2026
Copy link
Member

@prestonvasquez prestonvasquez left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@github-actions github-actions bot added the review-priority-normal Medium Priority PR for Review: within 1 business day label Jan 16, 2026
prestonvasquez
prestonvasquez previously approved these changes Jan 22, 2026
@qingyang-hu qingyang-hu merged commit 3483773 into mongodb:master Jan 22, 2026
31 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature review-priority-normal Medium Priority PR for Review: within 1 business day review-priority-urgent High Priority PR for Review: review immediately!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants