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
14 Get a newly allocated mongoc_collection_t for the collection named col‐
15 lection in the database named db.
16
17 TIP:
18 Collections are automatically created on the MongoDB server upon
19 insertion of the first document. There is no need to create a col‐
20 lection manually.
21
23 · client: A mongoc_client_t.
24
25 · db: The name of the database containing the collection.
26
27 · collection: The name of the collection.
28
30 A newly allocated mongoc_collection_t that should be freed with mon‐
31 goc_collection_destroy() when no longer in use.
32
34 MongoDB, Inc
35
37 2017-present, MongoDB, Inc
38
39
40
41
421.16.2 Feb 25, 2020 MONGOC_CLIENT_GET_COLLECTION(3)