1MONGOC_COLLECTION_COPY(3) libmongoc MONGOC_COLLECTION_COPY(3)
2
3
4
6 mongoc_collection_copy - mongoc_collection_copy()
7
9 mongoc_collection_t *
10 mongoc_collection_copy (mongoc_collection_t *collection)
11 BSON_GNUC_WARN_UNUSED_RESULT;
12
14 • collection: A mongoc_collection_t.
15
17 Performs a deep copy of the collection struct and its configuration.
18 Useful if you intend to call mongoc_collection_set_write_concern(),
19 mongoc_collection_set_read_prefs(), or
20 mongoc_collection_set_read_concern(), and want to preserve an unaltered
21 copy of the struct.
22
23 This function does not copy the contents of the collection on the Mon‐
24 goDB server.
25
27 A newly allocated mongoc_collection_t that should be freed with
28 mongoc_collection_destroy() when no longer in use.
29
31 MongoDB, Inc
32
34 2017-present, MongoDB, Inc
35
36
37
38
391.24.3 Aug 17, 2023 MONGOC_COLLECTION_COPY(3)