ClientEncryptionEncryptExpression Method  | 
 
            Encrypts a Match Expression or Aggregate Expression to query a range index.
            
 
    Namespace: 
   MongoDB.Driver.Encryption
    Assembly:
   MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.19.1+3a2a09dd959482f665ffbb5df2557ec541597af4
Syntaxpublic BsonDocument EncryptExpression(
	BsonDocument expression,
	EncryptOptions encryptOptions,
	CancellationToken cancellationToken = default
)
Public Function EncryptExpression ( 
	expression As BsonDocument,
	encryptOptions As EncryptOptions,
	Optional cancellationToken As CancellationToken = Nothing
) As BsonDocument
member EncryptExpression : 
        expression : BsonDocument * 
        encryptOptions : EncryptOptions * 
        ?cancellationToken : CancellationToken 
(* Defaults:
        let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> BsonDocument 
Parameters
- expression
 - Type: MongoDB.BsonBsonDocument
The expression that is expected to be a BSON document of one of the following forms:
            1. A Match Expression of this form:
              {$and: [{"field": {$gt: "value1"}}, {"field": {$lt: "value2" }}]}
            2. An Aggregate Expression of this form:
              {$and: [{$gt: ["fieldpath", "value1"]}, {$lt: ["fieldpath", "value2"]}]
            $gt may also be $gte. $lt may also be $lte.
             - encryptOptions
 - Type: MongoDB.Driver.EncryptionEncryptOptions
The encryption options. - cancellationToken (Optional)
 - Type: System.ThreadingCancellationToken
The cancellation token. 
Return Value
Type: 
BsonDocumentThe encrypted expression.
Remarks
            Only supported for queryType "rangePreview"
            The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
            
See Also