Function mongocrypt_sys::mongocrypt_ctx_mongo_op

source ยท
pub unsafe extern "C" fn mongocrypt_ctx_mongo_op(
    ctx: *mut mongocrypt_ctx_t,
    op_bson: *mut mongocrypt_binary_t,
) -> bool
Expand description

Get BSON necessary to run the mongo operation when mongocrypt_ctx_t is in MONGOCRYPT_CTX_NEED_MONGO_* states.

@p op_bson is a BSON document to be used for the operation.

  • For MONGOCRYPT_CTX_NEED_MONGO_COLLINFO(_WITH_DB) it is a listCollections filter.
  • For MONGOCRYPT_CTX_NEED_MONGO_KEYS it is a find filter.
  • For MONGOCRYPT_CTX_NEED_MONGO_MARKINGS it is a command to send to mongocryptd.

The lifetime of @p op_bson is tied to the lifetime of @p ctx. It is valid until @ref mongocrypt_ctx_destroy is called.

@param[in] ctx The @ref mongocrypt_ctx_t object. @param[out] op_bson A BSON document for the MongoDB operation. The data viewed by @p op_bson is guaranteed to be valid until @p ctx is destroyed with @ref mongocrypt_ctx_destroy. @returns A boolean indicating success. If false, an error status is set. Retrieve it with @ref mongocrypt_ctx_status