@@ -3783,7 +3783,7 @@ as `key1Document`.
3783
3783
Read the ` "_id" ` field of ` key1Document ` as ` key1ID ` .
3784
3784
3785
3785
Drop and create the collection ` db.explicit_encryption ` using ` encryptedFields ` as an option . See
3786
- [FLE 2 CreateCollection () and Collection .Drop ()](../ client - side - encryption .md #create - collection - helper ).
3786
+ [QE CreateCollection () and Collection .Drop ()](../ client - side - encryption .md #create - collection - helper ).
3787
3787
3788
3788
Drop and create the collection ` keyvault.datakeys ` .
3789
3789
@@ -3811,6 +3811,30 @@ class AutoEncryptionOpts {
3811
3811
}
3812
3812
` ` `
3813
3813
3814
+ Use ` clientEncryption ` to encrypt the string ` "foobarbaz" ` .
3815
+
3816
+ Encrypt using the following ` EncryptOpts ` :
3817
+
3818
+ ` ` ` typescript
3819
+ class EncryptOpts {
3820
+ keyId : <key1ID>,
3821
+ algorithm: "TextPreview",
3822
+ contentionFactor: 0,
3823
+ textOpts: TextOpts {
3824
+ caseSensitive: true,
3825
+ diacriticSensitive: true,
3826
+ prefix: <PrefixOpts>,
3827
+ suffix: <SuffixOpts>
3828
+ },
3829
+ }
3830
+ ` ` `
3831
+
3832
+ Use ` encryptedClient ` to insert the following document into ` db.explicit_encryption ` :
3833
+
3834
+ ` ` ` javascript
3835
+ { "_id": 0, "encryptedText": <encrypted "foobarbaz"> }
3836
+ ` ` `
3837
+
3814
3838
The remaining tasks require setting ` TextOpts ` . [Test Setup : TextOpts ](#test - setup - textopts ) lists the values to use for
3815
3839
` TextOpts ` for each of the supported data types .
3816
3840
@@ -3823,6 +3847,7 @@ This section lists the values to use for `TextOpts` for each query type. Include
3823
3847
class EncryptOpts {
3824
3848
keyId : <key1ID>,
3825
3849
algorithm: "TextPreview",
3850
+ queryType: "<prefix/suffix/substring>Preview",
3826
3851
contentionFactor: 0,
3827
3852
textOpts: TextOpts {
3828
3853
caseSensitive: true,
@@ -3860,30 +3885,6 @@ class EncryptOpts {
3860
3885
}
3861
3886
` ` `
3862
3887
3863
- Use ` clientEncryption ` to encrypt the string ` "foobarbaz" ` .
3864
-
3865
- Encrypt using the following ` EncryptOpts ` :
3866
-
3867
- ` ` ` typescript
3868
- class EncryptOpts {
3869
- keyId : <key1ID>,
3870
- algorithm: "TextPreview",
3871
- contentionFactor: 0,
3872
- textOpts: TextOpts {
3873
- caseSensitive: true,
3874
- diacriticSensitive: true,
3875
- prefix: <PrefixOpts>,
3876
- suffix: <SuffixOpts>
3877
- },
3878
- }
3879
- ` ` `
3880
-
3881
- Use ` encryptedClient ` to insert the following document into ` db.explicit_encryption ` :
3882
-
3883
- ` ` ` javascript
3884
- { "_id": 0, "encryptedText": <encrypted "foobarbaz"> }
3885
- ` ` `
3886
-
3887
3888
#### Case 1 : can find a document by prefix
3888
3889
3889
3890
Use ` clientEncryption.encrypt() ` to encrypt the string ` "foo" ` :
0 commit comments