1MONGOC_COLLECTION_SAVE(3)          libmongoc         MONGOC_COLLECTION_SAVE(3)
2
3
4

WARNING:

6          Deprecated  since  version  1.9.0:  This  function is deprecated and
7          should not be used in new code.
8
9          Please         use         mongoc_collection_insert_one()         or
10          mongoc_collection_replace_one() with "upsert" instead.
11
12

SYNOPSIS

14          bool
15          mongoc_collection_save (mongoc_collection_t *collection,
16                                  const bson_t *document,
17                                  const mongoc_write_concern_t *write_concern,
18                                  bson_error_t *error)
19             BSON_GNUC_DEPRECATED_FOR (mongoc_collection_insert_one or
20                                       mongoc_collection_replace_one);
21

PARAMETERS

23collection: A mongoc_collection_t.
24
25document: A bson_t containing the document.
26
27write_concern:  A  mongoc_write_concern_t  or  NULL for default write
28         concern.
29
30error: An optional location for a bson_error_t or NULL.
31

DESCRIPTION

33       This function shall save a document into collection.  If  the  document
34       has an _id field it will be updated. Otherwise it will be inserted.
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_SAVE(3)
Impressum