1MONGOC_DATABASE_CREATE_COLLECTION(3)libmongoMcONGOC_DATABASE_CREATE_COLLECTION(3)
2
3
4
6 mongoc_collection_t *
7 mongoc_database_create_collection (mongoc_database_t *database,
8 const char *name,
9 const bson_t *opts,
10 bson_error_t *error)
11 BSON_GNUC_WARN_UNUSED_RESULT;
12
14 • database: A mongoc_database_t.
15
16 • name: The name of the new collection.
17
18 • opts: An optional bson_t for opts to the create command.
19
20 • error: A location for a bson_error_t or NULL.
21
23 This function creates a mongoc_collection_t from the given
24 mongoc_database_t.
25
26 If no write concern is provided in opts, the database's write concern
27 is used.
28
29 The encryptedFields document in opts may be used to create a collection
30 used for Queryable Encryption.
31
32 For a list of all options, see the MongoDB Manual entry on the create
33 command.
34
36 Errors are propagated via the error parameter.
37
39 This function returns a newly allocated mongoc_collection_t upon suc‐
40 cess, NULL upon failure and error is set.
41
43 MongoDB, Inc
44
46 2017-present, MongoDB, Inc
47
48
49
50
511.25.1 Nov 08, 20M2O3NGOC_DATABASE_CREATE_COLLECTION(3)