Table of Contents

Method EncryptExpressionAsync

Namespace
MongoDB.Driver.Encryption
Assembly
MongoDB.Driver.Encryption.dll

EncryptExpressionAsync(BsonDocument, EncryptOptions, CancellationToken)

Encrypts a Match Expression or Aggregate Expression to query a range index.

public Task<BsonDocument> EncryptExpressionAsync(BsonDocument expression, EncryptOptions encryptOptions, CancellationToken cancellationToken = default)

Parameters

expression BsonDocument

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 EncryptOptions

The encryption options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<BsonDocument>

the encrypted expression.

Remarks

Only supported for queryType "range" The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.