| MONGOC_CLIENT_ENCRYPTION_CREATE_ENCRYPTED_COLLECTION(3) | libmongoc | MONGOC_CLIENT_ENCRYPTION_CREATE_ENCRYPTED_COLLECTION(3) |
mongoc_collection_t*
mongoc_client_encryption_create_encrypted_collection (
mongoc_client_encryption_t *enc,
mongoc_database_t *database,
const char *name,
const bson_t *in_options,
bson_t *out_options,
const char *kms_provider,
const bson_t *opt_masterKey,
bson_error_t *error)
BSON_GNUC_WARN_UNUSED_RESULT;
Create a new collection with Queryable Encryption enabled. Requires a valid mongoc_client_encryption_t object to operate.
New in version 1.24.0.
SEE ALSO:
If successful, this function returns a new mongoc_collection_t object. Upon failure, returns NULL and initializes *error with an error indicating the reason for failure. The returned collection object must be freed by the caller.
The in_options parameter behaves similarly to the opts parameter for mongoc_database_create_collection(), which accepts the options for the create MongoDB command (Documented here). The in_options document accepted here is different in one important way:
The $.encryptedFields.fields array is required by this function, and, unlike the schema documented for the create command, accepts a value of null for the keyId parameter on each array element.
This function has the following as-if effect:
MongoDB, Inc
2017-present, MongoDB, Inc
| March 31, 2024 | 1.26.0 |