SYNOPSIS

bool
mongoc_collection_insert (mongoc_collection_t          *collection,
                          mongoc_insert_flags_t         flags,
                          const bson_t                 *document,
                          const mongoc_write_concern_t *write_concern,
                          bson_error_t                 *error);

bool
mongoc_collection_insert_bulk (mongoc_collection_t          *collection,
                               mongoc_insert_flags_t         flags,
                               const bson_t                **documents,
                               uint32_t                      n_documents,
                               const mongoc_write_concern_t *write_concern,
                               bson_error_t                 *error);

DESCRIPTION

The mongoc_collection_insert() function shall insert a document into a collection.

The mongoc_collection_insert_bulk() function shall insert n_documents documents into a collection.

FLAGS

MONGOC_INSERT_NONE

Specify no insert flags.

MONGOC_INSERT_CONTINUE_ON_ERROR

Continue inserting documents from the insertion set even if one fails.

RETURN VALUE

The mongoc_collection_insert() function returns a true if successful.

ERRORS

errors are returned through error

SEE ALSO

AUTHORS

This page was written by MongoDB Inc.