@@ -48,6 +48,8 @@ QEv1 and QEv2 are incompatible.
48
48
MongoDB 8.0 dropped ` queryType=rangePreview ` and added ` queryType=range `
49
49
([ SPM-3583] ( https://jira.mongodb.org/browse/SPM-3583 ) ).
50
50
51
+ MongoDB 8.2 added unstable support for QE text queries ([ SPM-2880] ( https://jira.mongodb.org/browse/SPM-2880 ) )
52
+
51
53
## META
52
54
53
55
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
@@ -1256,6 +1258,7 @@ class EncryptOpts {
1256
1258
contentionFactor: Optional <Int64 >,
1257
1259
queryType: Optional <String >
1258
1260
rangeOpts: Optional <RangeOpts >
1261
+ textOpts: Optional <TextOpts >
1259
1262
}
1260
1263
1261
1264
// RangeOpts specifies index options for a Queryable Encryption field supporting "range" queries.
@@ -1273,6 +1276,48 @@ class RangeOpts {
1273
1276
// precision determines the number of significant digits after the decimal point. May only be set for double or decimal128.
1274
1277
precision: Optional <Int32 >
1275
1278
}
1279
+
1280
+ // TextOpts specifies options for a Queryable Encryption field supporting text queries.
1281
+ // NOTE: TextOpts is currently unstable API and subject to backwards breaking changes.
1282
+ class TextOpts {
1283
+ // substring contains further options to support substring queries.
1284
+ substring: Optional <SubstringOpts >,
1285
+ // prefix contains further options to support prefix queries.
1286
+ prefix: Optional <PrefixOpts >,
1287
+ // suffix contains further options to support suffix queries.
1288
+ suffix: Optional <SuffixOpts >,
1289
+ // caseSensitive determines whether text indexes for this field are case sensitive.
1290
+ caseSensitive: bool ,
1291
+ // diacriticSensitive determines whether text indexes for this field are diacritic sensitive.
1292
+ diacriticSensitive: bool
1293
+ }
1294
+
1295
+ // NOTE: SubstringOpts is currently unstable API and subject to backwards breaking changes.
1296
+ class SubstringOpts {
1297
+ // strMaxLength is the maximum allowed length to insert. Inserting longer strings will error.
1298
+ strMaxLength: Int32 ,
1299
+ // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
1300
+ strMinQueryLength: Int32 ,
1301
+ // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
1302
+ strMaxQueryLength: Int32 ,
1303
+ }
1304
+
1305
+ // NOTE: PrefixOpts is currently unstable API and subject to backwards breaking changes.
1306
+ class PrefixOpts {
1307
+ // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
1308
+ strMinQueryLength: Int32 ,
1309
+ // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
1310
+ strMaxQueryLength: Int32 ,
1311
+ }
1312
+
1313
+ // NOTE: SuffixOpts is currently unstable API and subject to backwards breaking changes.
1314
+ class SuffixOpts {
1315
+ // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
1316
+ strMinQueryLength: Int32 ,
1317
+ // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
1318
+ strMaxQueryLength: Int32 ,
1319
+ }
1320
+
1276
1321
` ` `
1277
1322
1278
1323
Explicit encryption requires a key and algorithm. Keys are either identified by ` _id ` or by alternate name. Exactly one
@@ -1295,34 +1340,45 @@ One of the strings:
1295
1340
- "Indexed"
1296
1341
- "Unindexed"
1297
1342
- "Range"
1343
+ - "TextPreview"
1298
1344
1299
- The result of explicit encryption with the "Indexed" or "Range " algorithm must be processed by the server to insert or
1300
- query. Drivers MUST document the following behavior:
1345
+ The result of explicit encryption with the "Indexed", "Range", or "TextPreview " algorithm must be processed by the
1346
+ server to insert or query. Drivers MUST document the following behavior:
1301
1347
1302
- > To insert or query with an "Indexed" or "Range " encrypted payload, use a ` MongoClient ` configured with
1348
+ > To insert or query with an "Indexed", "Range", or "TextPreview " encrypted payload, use a ` MongoClient ` configured with
1303
1349
> ` AutoEncryptionOpts ` . ` AutoEncryptionOpts .bypassQueryAnalysis ` may be true. ` AutoEncryptionOpts .bypassAutoEncryption `
1304
- > must be false.
1350
+ > must be false. The "TextPreview" algorithm is in preview and should be used for experimental workloads only. These
1351
+ > features are unstable and their security is not guaranteed until released as Generally Available (GA). The GA version
1352
+ > of these features may not be backwards compatible with the preview version.
1305
1353
1306
1354
#### contentionFactor
1307
1355
1308
- contentionFactor may be used to tune performance. Only applies when algorithm is "Indexed" or "Range". libmongocrypt
1309
- returns an error if contentionFactor is set for a non-applicable algorithm.
1356
+ contentionFactor may be used to tune performance. Only applies when algorithm is "Indexed", "Range", or "TextPreview".
1357
+ libmongocrypt returns an error if contentionFactor is set for a non-applicable algorithm.
1310
1358
1311
1359
#### queryType
1312
1360
1313
1361
One of the strings:
1314
1362
1315
1363
- "equality"
1316
1364
- "range"
1365
+ - "prefixPreview"
1366
+ - "suffixPreview"
1367
+ - "substringPreview"
1317
1368
1318
- queryType only applies when algorithm is "Indexed" or "Range ". libmongocrypt returns an error if queryType is set for a
1319
- non-applicable queryType .
1369
+ queryType only applies when algorithm is "Indexed", "Range", or "TextPreview ". libmongocrypt returns an error if
1370
+ queryType is set for a non-applicable algorithm .
1320
1371
1321
1372
#### rangeOpts
1322
1373
1323
1374
rangeOpts only applies when algorithm is "Range". libmongocrypt returns an error if rangeOpts is set for a
1324
1375
non-applicable algorithm.
1325
1376
1377
+ #### textOpts
1378
+
1379
+ textOpts only applies when algorithm is "TextPreview". libmongocrypt returns an error if textOpts is set for a
1380
+ non-applicable algorithm.
1381
+
1326
1382
## User facing API: When Auto Encryption Fails
1327
1383
1328
1384
Auto encryption requires parsing the MongoDB query language client side (with the [mongocryptd](#mongocryptd) process or
@@ -2463,6 +2519,8 @@ explicit session parameter as described in the [Drivers Sessions Specification](
2463
2519
2464
2520
## Changelog
2465
2521
2522
+ - 2025 -08 -06 : Add ` TextPreview ` algorithm .
2523
+
2466
2524
- 2024 -02 -19 : Add custom options AWS credential provider .
2467
2525
2468
2526
- 2024 -10 -09 : Add retry prose test .
0 commit comments