1MONGOC_CLIENT_GET_COLLECTION(3) libmongoc MONGOC_CLIENT_GET_COLLECTION(3)
2
3
4
6 mongoc_client_get_collection - mongoc_client_get_collection()
7
9 mongoc_collection_t *
10 mongoc_client_get_collection (mongoc_client_t *client,
11 const char *db,
12 const char *collection)
13 BSON_GNUC_WARN_UNUSED_RESULT;
14
15 Get a newly allocated mongoc_collection_t for the collection named col‐
16 lection in the database named db.
17
18 TIP:
19 Collections are automatically created on the MongoDB server upon in‐
20 sertion of the first document. There is no need to create a collec‐
21 tion manually.
22
24 • client: A mongoc_client_t.
25
26 • db: The name of the database containing the collection.
27
28 • collection: The name of the collection.
29
31 A newly allocated mongoc_collection_t that should be freed with mon‐
32 goc_collection_destroy() when no longer in use.
33
35 MongoDB, Inc
36
38 2017-present, MongoDB, Inc
39
40
41
42
431.20.0 Nov 18, 2021 MONGOC_CLIENT_GET_COLLECTION(3)