@@ -14,6 +14,15 @@ const metadata: MongoDBMetadataUI = {
1414 libmongocrypt : '>=1.15.1'
1515 }
1616} ;
17+ // # Server 9.0.0-rc0 removes support for "prefixPreview" and "suffixPreview": SERVER-123416
18+ const metadataWithoutPreview : MongoDBMetadataUI = {
19+ requires : {
20+ clientSideEncryption : '>=6.4.0' ,
21+ mongodb : '>=8.2.0 <9.0.0' ,
22+ topology : '!single' ,
23+ libmongocrypt : '>=1.15.1'
24+ }
25+ } ;
1726
1827const loadFLEDataFile = async ( filename : string ) =>
1928 EJSON . parse (
@@ -36,6 +45,7 @@ describe('27. Text Explicit Encryption', function () {
3645
3746 // Using QE CreateCollection() and Collection.Drop(), drop and create the following collections with majority write concern:
3847 // - db.prefix-suffix using the encryptedFields option set to the contents of encryptedFields-prefix-suffix.json
48+ // Skip this step if testing server 9.0.0+.
3949 // - db.substring using the encryptedFields option set to the contents of encryptedFields-substring.json
4050 async function dropAndCreateCollection ( ns : string , encryptedFields ?: Document ) {
4151 const { db, collection } = MongoDBCollectionNamespace . fromString ( ns ) ;
@@ -208,7 +218,7 @@ describe('27. Text Explicit Encryption', function () {
208218 await Promise . allSettled ( [ utilClient . close ( ) , encryptedClient . close ( ) , keyVaultClient . close ( ) ] ) ;
209219 } ) ;
210220
211- it ( 'Case 1: can find a document by prefix' , metadata , async function ( ) {
221+ it ( 'Case 1: can find a document by prefix' , metadataWithoutPreview , async function ( ) {
212222 // Use clientEncryption.encrypt() to encrypt the string "foo" with the following EncryptOpts:
213223 // class EncryptOpts {
214224 // keyId : <key1ID>,
@@ -260,7 +270,7 @@ describe('27. Text Explicit Encryption', function () {
260270 expect ( result ) . to . deep . equal ( { _id : 0 , encryptedText : 'foobarbaz' } ) ;
261271 } ) ;
262272
263- it ( 'Case 2: can find a document by suffix' , metadata , async function ( ) {
273+ it ( 'Case 2: can find a document by suffix' , metadataWithoutPreview , async function ( ) {
264274 // Use clientEncryption.encrypt() to encrypt the string "baz" with the following EncryptOpts:
265275 // class EncryptOpts {
266276 // keyId : <key1ID>,
@@ -311,7 +321,7 @@ describe('27. Text Explicit Encryption', function () {
311321 expect ( result ) . to . deep . equal ( { _id : 0 , encryptedText : 'foobarbaz' } ) ;
312322 } ) ;
313323
314- it ( 'Case 3: assert no document found by prefix' , metadata , async function ( ) {
324+ it ( 'Case 3: assert no document found by prefix' , metadataWithoutPreview , async function ( ) {
315325 // Use clientEncryption.encrypt() to encrypt the string "baz" with the following EncryptOpts:
316326 // class EncryptOpts {
317327 // keyId : <key1ID>,
@@ -351,7 +361,7 @@ describe('27. Text Explicit Encryption', function () {
351361 expect ( await encryptedClient . db ( 'db' ) . collection ( 'prefix-suffix' ) . findOne ( filter ) ) . to . be . null ;
352362 } ) ;
353363
354- it ( 'Case 4: assert no document found by suffix' , metadata , async function ( ) {
364+ it ( 'Case 4: assert no document found by suffix' , metadataWithoutPreview , async function ( ) {
355365 // Use clientEncryption.encrypt() to encrypt the string "foo" with the following EncryptOpts:
356366 // class EncryptOpts {
357367 // keyId : <key1ID>,
@@ -497,7 +507,7 @@ describe('27. Text Explicit Encryption', function () {
497507 expect ( result ) . to . be . null ;
498508 } ) ;
499509
500- it ( 'Case 7: assert contentionFactor is required' , metadata , async function ( ) {
510+ it ( 'Case 7: assert contentionFactor is required' , metadataWithoutPreview , async function ( ) {
501511 // Use clientEncryption.encrypt() to encrypt the string "foo" with the following EncryptOpts:
502512 // class EncryptOpts {
503513 // keyId : <key1ID>,
0 commit comments