MongoDB C++ Driver
mongocxx-3.0.0
|
Class representing the optional arguments to a MongoDB bulk write. More...
#include <bulk_write.hpp>
Public Member Functions | |
bulk_write () | |
Constructs a new bulk_write object. More... | |
void | ordered (bool ordered) |
Sets whether the writes must be executed in order by the server. More... | |
bool | ordered () const |
Gets the current value of the ordered option. More... | |
void | write_concern (class write_concern wc) |
Sets the write_concern for this operation. More... | |
const stdx::optional< class write_concern > & | write_concern () const |
The current write_concern for this operation. More... | |
void | bypass_document_validation (bool bypass_document_validation) |
Set whether or not to bypass document validation for this operation. More... | |
const stdx::optional< bool > | bypass_document_validation () const |
The current setting for bypassing document validation for this operation. More... | |
Class representing the optional arguments to a MongoDB bulk write.
mongocxx::options::bulk_write::bulk_write | ( | ) |
Constructs a new bulk_write object.
By default, bulk writes are considered ordered as this is the only safe choice. If you want an unordered update, you must call ordered(false) to switch to unordered mode.
void mongocxx::options::bulk_write::bypass_document_validation | ( | bool | bypass_document_validation | ) |
Set whether or not to bypass document validation for this operation.
bypass_document_validation | Whether or not to bypass document validation. |
const stdx::optional<bool> mongocxx::options::bulk_write::bypass_document_validation | ( | ) | const |
The current setting for bypassing document validation for this operation.
void mongocxx::options::bulk_write::ordered | ( | bool | ordered | ) |
Sets whether the writes must be executed in order by the server.
The server-side default is true
.
ordered | If true all write operations will be executed serially in the order they were appended, and the entire bulk operation will abort on the first error. If false operations will be executed in arbitrary order (possibly in parallel on the server) and any errors will be reported after attempting all operations. |
bool mongocxx::options::bulk_write::ordered | ( | ) | const |
Gets the current value of the ordered option.
void mongocxx::options::bulk_write::write_concern | ( | class write_concern | wc | ) |
Sets the write_concern for this operation.
wc | The new write_concern. |
const stdx::optional<class write_concern>& mongocxx::options::bulk_write::write_concern | ( | ) | const |
The current write_concern for this operation.