mongoc_bulk_operation_execute man page

mongoc_bulk_operation_execute() — None

Synopsis

uint32_t
mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk,
                               bson_t                  *reply,
                               bson_error_t            *error);

This function executes all operations queued into the bulk operation. If ordered was specified to mongoc_collection_create_bulk_operation(3) , then forward progress will be stopped upon the first error.

It is only valid to call mongoc_bulk_operation_execute(3) once. The mongoc_bulk_operation_t must be destroyed afterwards.

NOTE

reply is always initialized, even upon failure. Callers must call bson_destroy(3) to release this potential allocation.

Parameters

bulk
A mongoc_bulk_operation_t
reply
An uninitialized bson_t
error
An optional location for a bson_error_t or NULL

See Also

Bulk Write Operations

Errors

Errors are propagated via the error parameter.

Returns

On success, returns the server id used. On failure, returns 0 and sets error

A write concern timeout or write concern error is considered a failure.

The reply document counts operations and collects error information. See Bulk Write Operations for examples.

See also mongoc_bulk_operation_get_hint , which gets the id of the server used even if the operation failed.

Colophon

This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.

Referenced By

mongoc_bulk(3), mongoc_bulk_operation_delete(3), mongoc_bulk_operation_delete_one(3), mongoc_bulk_operation_insert(3), mongoc_bulk_operation_remove(3), mongoc_bulk_operation_remove_many_with_opts(3), mongoc_bulk_operation_remove_one(3), mongoc_bulk_operation_remove_one_with_opts(3), mongoc_bulk_operation_replace_one(3), mongoc_bulk_operation_replace_one_with_opts(3), mongoc_bulk_operation_t(3), mongoc_bulk_operation_update(3), mongoc_bulk_operation_update_many_with_opts(3), mongoc_bulk_operation_update_one(3), mongoc_bulk_operation_update_one_with_opts(3), mongoc_collection_create_bulk_operation(3).

2016‐11‐07 MongoDB C Driver