@@ -3457,6 +3457,7 @@ Use `encryptedClient` to drop and create the following collections:
34573457- ` db.qe2 ` with options : ` { "encryptedFields": "<schema-qe2.json>"} ` .
34583458- ` db.no_schema ` with no options .
34593459- ` db.no_schema2 ` with no options .
3460+ - ` db.non_csfle_schema ` with options : ` { "validator": { "$jsonSchema": "<schema-non-csfle.json>"}} `
34603461
34613462Create an unencrypted MongoClient named ` unencryptedClient ` .
34623463
@@ -3472,6 +3473,7 @@ Insert documents with `encryptedClient`:
34723473 - Use ` unencryptedClient ` to retrieve it . Assert the ` qe2 ` field is BSON binary .
34733474- ` {"no_schema": "no_schema"} ` into ` db.no_schema `
34743475- ` {"no_schema2": "no_schema2"} ` into ` db.no_schema2 `
3476+ - ` {"non_csfle_schema": "non_csfle_schema"} ` into ` db.non_csfle_schema `
34753477
34763478#### Case 1 : ` db.csfle ` joins ` db.no_schema `
34773479
@@ -3652,7 +3654,7 @@ Expect one document to be returned matching:
36523654
36533655#### Case 8 : ` db.csfle ` joins ` db.qe `
36543656
3655- Test requires server 8.1 + and mongocryptd / crypt_shared 8.1 + .
3657+ Test requires server 8.1 + and mongocryptd / crypt_shared 8.1 +
36563658
36573659Recreate ` encryptedClient ` with the same ` AutoEncryptionOpts ` as the setup . (Recreating prevents schema caching from
36583660impacting the test ).
@@ -3673,7 +3675,12 @@ Run an aggregate operation on `db.csfle` with the following pipeline:
36733675]
36743676` ` `
36753677
3676- Expect an exception to be thrown with a message containing the substring ` not supported ` .
3678+ Expect an exception to be thrown with a message containing one of the following substrings depending on the
3679+ mongocryptd / crypt_shared and libmongocrypt versions :
3680+
3681+ - mongocryptd / crypt_shared \< 8.2 ** or ** libmongocrypt \< 1.17 .0 : ` not supported ` .
3682+ - mongocryptd / crypt_shared 8.2 + ** and ** libmongocrypt 1.17 .0 + :
3683+ ` Cannot specify both encryptionInformation and csfleEncryptionSchemas unless csfleEncryptionSchemas only contains non-encryption JSON schema validators ` .
36773684
36783685#### Case 9 : test error with \< 8.1
36793686
@@ -3700,6 +3707,31 @@ Run an aggregate operation on `db.csfle` with the following pipeline:
37003707
37013708Expect an exception to be thrown with a message containing the substring ` Upgrade ` .
37023709
3710+ #### Case 10 : ` db.qe ` joins ` db.non_csfle_schema `
3711+
3712+ Test requires server 8.2 + , mongocryptd / crypt_shared 8.2 + , and libmongocrypt 1.17 .0 + .
3713+
3714+ Recreate ` encryptedClient ` with the same ` AutoEncryptionOpts ` as the setup . (Recreating prevents schema caching from
3715+ impacting the test ).
3716+
3717+ Run an aggregate operation on ` db.qe ` with the following pipeline :
3718+
3719+ ` ` ` json
3720+ [
3721+ {"$match" : {"qe" : "qe"}},
3722+ {
3723+ "$lookup" : {
3724+ "from" : "non_csfle_schema",
3725+ "as" : "matched",
3726+ "pipeline" : [ {"$match" : {"non_csfle_schema" : "non_csfle_schema"}}, {"$project" : {"_id" : 0, "__safeContent__" : 0}} ]
3727+ }
3728+ },
3729+ {"$project" : {"_id" : 0, "__safeContent__" : 0}}
3730+ ]
3731+ ` ` `
3732+
3733+ Expect one document to be returned matching : ` {"qe" : "qe", "matched" : [ {"non_csfle_schema" : "non_csfle_schema"} ]} ` .
3734+
37033735### 26. Custom AWS Credentials
37043736
37053737These tests require valid AWS credentials for the remote KMS provider via the secrets manager (FLE_AWS_KEY and
0 commit comments