@@ -3767,8 +3767,8 @@ Assert that an error is thrown.
3767
3767
3768
3768
### 27. Text Explicit Encryption
3769
3769
3770
- The Text Explicit Encryption tests utilize Queryable Encryption (QE ) range protocol V2 and require MongoDB server
3771
- 8.2 . 0 + and libmongocrypt 1.15 .0 + . The tests must not run against a standalone .
3770
+ The Text Explicit Encryption tests utilize Queryable Encryption (QE ) range protocol V2 and require MongoDB server 8.2 . 0 +
3771
+ and libmongocrypt 1.15 .0 + . The tests must not run against a standalone .
3772
3772
3773
3773
Before running each of the following test cases , perform the following Test Setup .
3774
3774
@@ -3811,8 +3811,8 @@ class AutoEncryptionOpts {
3811
3811
}
3812
3812
` ` `
3813
3813
3814
- The remaining tasks require setting ` TextOpts ` . [Test Setup : TextOpts ](#test - setup - textopts ) lists the values to use
3815
- for ` TextOpts ` for each of the supported data types .
3814
+ The remaining tasks require setting ` TextOpts ` . [Test Setup : TextOpts ](#test - setup - textopts ) lists the values to use for
3815
+ ` TextOpts ` for each of the supported data types .
3816
3816
3817
3817
#### Test Setup : TextOpts
3818
3818
@@ -3834,31 +3834,31 @@ class EncryptOpts {
3834
3834
3835
3835
1. Prefix
3836
3836
3837
- ` ` ` typescript
3838
- class PrefixOpts {
3839
- strMaxQueryLength: 10,
3840
- strMinQueryLength: 2,
3841
- }
3842
- ` ` `
3837
+ ` ` ` typescript
3838
+ class PrefixOpts {
3839
+ strMaxQueryLength: 10,
3840
+ strMinQueryLength: 2,
3841
+ }
3842
+ ` ` `
3843
3843
3844
3844
2. Suffix
3845
3845
3846
- ` ` ` typescript
3847
- class SuffixOpts {
3848
- strMaxQueryLength: 10,
3849
- strMinQueryLength: 2,
3850
- }
3851
- ` ` `
3846
+ ` ` ` typescript
3847
+ class SuffixOpts {
3848
+ strMaxQueryLength: 10,
3849
+ strMinQueryLength: 2,
3850
+ }
3851
+ ` ` `
3852
3852
3853
3853
3. Substring
3854
3854
3855
- ` ` ` typescript
3856
- class SubstringOpts {
3857
- strMaxLength: 10,
3858
- strMaxQueryLength: 10,
3859
- strMinQueryLength: 2,
3860
- }
3861
- ` ` `
3855
+ ` ` ` typescript
3856
+ class SubstringOpts {
3857
+ strMaxLength: 10,
3858
+ strMaxQueryLength: 10,
3859
+ strMinQueryLength: 2,
3860
+ }
3861
+ ` ` `
3862
3862
3863
3863
Use ` clientEncryption ` to encrypt the string ` "foobarbaz" ` .
3864
3864
@@ -3889,10 +3889,13 @@ Use `encryptedClient` to insert the following document into `db.explicit_encrypt
3889
3889
Use ` clientEncryption.encrypt() ` to encrypt the string ` "foo" ` :
3890
3890
3891
3891
Store this query in ` findPayload ` .
3892
+
3892
3893
` ` ` javascript
3893
3894
{ "$expr": { "$encStrStartsWith": {"input": "encryptedText", "prefix": <encrypted "foo">}, } }
3894
3895
` ` `
3895
- Use ` encryptedClient ` to run a " find" operation on the ` db.explicit_encryption ` collection with the filter ` findPayload ` .
3896
+
3897
+ Use ` encryptedClient ` to run a " find" operation on the ` db.explicit_encryption ` collection with the filter
3898
+ ` findPayload ` .
3896
3899
3897
3900
Assert the following document is returned :
3898
3901
@@ -3905,12 +3908,13 @@ Assert the following document is returned:
3905
3908
Use ` clientEncryption.encrypt() ` to encrypt the string ` "baz" ` :
3906
3909
3907
3910
Store this query in ` findPayload ` .
3911
+
3908
3912
` ` ` javascript
3909
3913
{ "$expr": { "$encStrStartsWith": {"input": "encryptedText", "prefix": <encrypted "baz">}, } }
3910
3914
` ` `
3911
3915
3912
- Store the result in ` findPayload ` .
3913
- Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption ` collection with the filter ` findPayload ` .
3916
+ Store the result in ` findPayload ` . Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption `
3917
+ collection with the filter ` findPayload ` .
3914
3918
3915
3919
Assert the following document is returned :
3916
3920
@@ -3923,12 +3927,13 @@ Assert the following document is returned:
3923
3927
Use ` clientEncryption.encrypt() ` to encrypt the string ` "baz" ` :
3924
3928
3925
3929
Store this query in ` findPayload ` .
3930
+
3926
3931
` ` ` javascript
3927
3932
{ "$expr": { "$encStrStartsWith": {"input": "encryptedText", "prefix": <encrypted "baz">}, } }
3928
3933
` ` `
3929
3934
3930
- Store the result in ` findPayload ` .
3931
- Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption ` collection with the filter ` findPayload ` .
3935
+ Store the result in ` findPayload ` . Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption `
3936
+ collection with the filter ` findPayload ` .
3932
3937
3933
3938
Assert that no documents are returned .
3934
3939
@@ -3937,16 +3942,18 @@ Assert that no documents are returned.
3937
3942
Use ` clientEncryption.encrypt() ` to encrypt the string ` "foo" ` :
3938
3943
3939
3944
Store this query in ` findPayload ` .
3945
+
3940
3946
` ` ` javascript
3941
3947
{ "$expr": { "$encStrStartsWith": {"input": "encryptedText", "suffix": <encrypted "foo">}, } }
3942
3948
` ` `
3943
3949
3944
- Store the result in ` findPayload ` .
3945
- Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption ` collection with the filter ` findPayload ` .
3950
+ Store the result in ` findPayload ` . Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption `
3951
+ collection with the filter ` findPayload ` .
3946
3952
3947
3953
Assert that no documents are returned .
3948
3954
3949
3955
#### Substring test setup
3956
+
3950
3957
Load the file ` encryptedFields-substring.json ` as ` encryptedFields ` .
3951
3958
3952
3959
Load the file
@@ -3979,15 +3986,17 @@ Use `encryptedClient` to insert the following document into `db.explicit_encrypt
3979
3986
` ` `
3980
3987
3981
3988
#### Case 5 : can find a document by substring
3989
+
3982
3990
Use ` clientEncryption.encrypt() ` to encrypt the string ` "bar" ` :
3983
3991
3984
3992
Store this query in ` findPayload ` .
3993
+
3985
3994
` ` ` javascript
3986
3995
{ "$expr": { "$encStrStartsWith": {"input": "encryptedText", "prefix": <encrypted "bar">}, } }
3987
3996
` ` `
3988
3997
3989
- Store the result in ` findPayload ` .
3990
- Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption ` collection with the filter ` findPayload ` .
3998
+ Store the result in ` findPayload ` . Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption `
3999
+ collection with the filter ` findPayload ` .
3991
4000
3992
4001
Assert the following document is returned :
3993
4002
@@ -4000,11 +4009,12 @@ Assert the following document is returned:
4000
4009
Use ` clientEncryption.encrypt() ` to encrypt the string ` "qux" ` :
4001
4010
4002
4011
Store this query in ` findPayload ` .
4012
+
4003
4013
` ` ` javascript
4004
4014
{ "$expr": { "$encStrStartsWith": {"input": "encryptedText", "prefix": <encrypted "qux">}, } }
4005
4015
` ` `
4006
4016
4007
- Store the result in ` findPayload ` .
4008
- Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption ` collection with the filter ` findPayload ` .
4017
+ Store the result in ` findPayload ` . Use ` encryptedClient ` to run a " find " operation on the ` db.explicit_encryption `
4018
+ collection with the filter ` findPayload ` .
4009
4019
4010
- Assert that no documents are returned .
4020
+ Assert that no documents are returned .
0 commit comments