GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MONGOC_CLIENT_ENCRYPTION_ENCRYPT_EXPRESSION(3) libmongoc MONGOC_CLIENT_ENCRYPTION_ENCRYPT_EXPRESSION(3)

bool
mongoc_client_encryption_encrypt_expression (

mongoc_client_encryption_t *client_encryption,
const bson_t *expr,
mongoc_client_encryption_encrypt_opts_t *opts,
bson_t *expr_out,
bson_error_t *error);


New in version 1.24.0.

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

To query with a Range encrypted payload, use a mongoc_client_t configured with mongoc_auto_encryption_opts_t. The mongoc_auto_encryption_opts_t may be configured to bypass query analysis with mongoc_auto_encryption_opts_set_bypass_query_analysis(). The mongoc_auto_encryption_opts_t must not be configured to bypass automatic encryption with mongoc_auto_encryption_opts_set_bypass_auto_encryption().

To query with a Range payload, expr must be one of the following forms:

1.
A Match Expression of the following form:

// $gt may also be $gte. $lt may also be $lte.
// Can include one of $gt/$gte/$lt/$lte. It is not required to include both.
{"$and": [{"<field>": {"$gt": "<value1>"}}, {"<field>": {"$lt": "<value2>" }}]}


2.
An Aggregation Expression of this form:

// $gt may also be $gte. $lt may also be $lte
// Can include one of $gt/$gte/$lt/$lte. It is not required to include both.
{"$and": [{"$gt": ["<fieldpath>", "<value1>"]}, {"$lt": ["<fieldpath>", "<value2>"]}]



  • client_encryption: A mongoc_client_encryption_t
  • expr: The expression to encrypt.
  • opts: A mongoc_client_encryption_encrypt_opts_t.
  • expr_out: A bson_t for the resulting encrypted expression. expr_out is always initialized (even on failure). Caller must call bson_destroy() to free.
  • error: A bson_error_t set on failure.

Returns true if successful. Returns false and sets error otherwise.

SEE ALSO:

mongoc_client_encryption_encrypt_opts_t

mongoc_client_enable_auto_encryption()

mongoc_client_decryption_decrypt()



MongoDB, Inc

2009-present, MongoDB, Inc.

July 3, 2025 1.30.4

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.