1MONGOC_COLLECTION_INSERT(3)        libmongoc       MONGOC_COLLECTION_INSERT(3)
2
3
4

SYNOPSIS

6          bool
7          mongoc_collection_insert (mongoc_collection_t *collection,
8                                    mongoc_insert_flags_t flags,
9                                    const bson_t *document,
10                                    const mongoc_write_concern_t *write_concern,
11                                    bson_error_t *error);
12

PARAMETERS

14collection: A mongoc_collection_t.
15
16flags: A mongoc_insert_flags_t.
17
18document: A bson_t.
19
20write_concern: A mongoc_write_concern_t.
21
22error: An optional location for a bson_error_t or NULL.
23

DESCRIPTION

25       Superseded         by         mongoc_collection_insert_one()        and
26       mongoc_collection_insert_many().
27
28       This function shall insert document into collection.
29
30       If no _id element is found in document, then a bson_oid_t will be  gen‐
31       erated locally and added to the document. If you must know the inserted
32       document's _id, generate it in your code and include it  in  the  docu‐
33       ment.  The  _id you generate can be a bson_oid_t or any other non-array
34       BSON type.
35

ERRORS

37       Errors are propagated via the error parameter.
38

RETURNS

40       Returns true if successful. Returns false and sets error if  there  are
41       invalid arguments or a server or network error.
42
43       A write concern timeout or write concern error is considered a failure.
44

AUTHOR

46       MongoDB, Inc
47
49       2017-present, MongoDB, Inc
50
51
52
53
541.25.1                           Nov 08, 2023      MONGOC_COLLECTION_INSERT(3)
Impressum