mongoc_database_create_collection(3)

mongoc_database_create_collection3

Usage

mongoc_collection_t *
mongoc_database_create_collection (mongoc_database_t *database,
                                   const char *name,
                                   const bson_t *opts,
                                   bson_error_t *error);

Parameters

•

database: A mongoc_database_t.

•

name: The name of the new collection.

•

opts: An optional bson_t for opts to the create command.

•

error: A location for a bson_error_t or NULL.

Overview

This function creates a mongoc_collection_t from the given mongoc_database_t.

If no write concern is provided in opts, the database's write concern is used.

The encryptedFields document in opts may be used to create a collection used for Queryable Encryption.

For a list of all options, see the MongoDB Manual entry on the create command.

Errors

Errors are propagated via the error parameter.

Returns

This function returns a newly allocated mongoc_collection_t upon success, NULL upon failure and error is set.

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Author

MongoDB, Inc

From libmongoc-doc 1.30.4-1+deb13u3 in Debian 13 (Trixie). Parsed by carta from the page's man source.