MongoDB C++ Driver  mongocxx-3.7.0
Public Member Functions | List of all members
mongocxx::options::bulk_write Class Reference

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...
 
bulk_writeordered (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...
 
bulk_writewrite_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...
 
bulk_writebypass_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...
 
bulk_writelet (bsoncxx::document::view_or_value let)
 Set the value of the let option. More...
 
const stdx::optional< bsoncxx::document::view_or_valuelet () const
 Gets the current value of the let option. More...
 
bulk_writecomment (bsoncxx::types::bson_value::view_or_value comment)
 Set the value of the comment option. More...
 
const stdx::optional< bsoncxx::types::bson_value::view_or_valuecomment () const
 Gets the current value of the comment option. More...
 

Detailed Description

Class representing the optional arguments to a MongoDB bulk write.

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ bypass_document_validation() [1/2]

const stdx::optional<bool> mongocxx::options::bulk_write::bypass_document_validation ( ) const

The current setting for bypassing document validation for this operation.

Returns
The current document validation bypass setting.

◆ bypass_document_validation() [2/2]

bulk_write& mongocxx::options::bulk_write::bypass_document_validation ( bool  bypass_document_validation)

Set whether or not to bypass document validation for this operation.

Parameters
bypass_document_validationWhether or not to bypass document validation.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ comment() [1/2]

const stdx::optional<bsoncxx::types::bson_value::view_or_value> mongocxx::options::bulk_write::comment ( ) const

Gets the current value of the comment option.

Returns
The current comment option.

◆ comment() [2/2]

bulk_write& mongocxx::options::bulk_write::comment ( bsoncxx::types::bson_value::view_or_value  comment)

Set the value of the comment option.

Parameters
commentThe new comment option.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ let() [1/2]

const stdx::optional<bsoncxx::document::view_or_value> mongocxx::options::bulk_write::let ( ) const

Gets the current value of the let option.

Returns
The current let option.

◆ let() [2/2]

bulk_write& mongocxx::options::bulk_write::let ( bsoncxx::document::view_or_value  let)

Set the value of the let option.

Parameters
letThe new let option.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ ordered() [1/2]

bool mongocxx::options::bulk_write::ordered ( ) const

Gets the current value of the ordered option.

Returns
The value of the ordered option.

◆ ordered() [2/2]

bulk_write& 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.

Parameters
orderedIf 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.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ write_concern() [1/2]

const stdx::optional<class write_concern>& mongocxx::options::bulk_write::write_concern ( ) const

The current write_concern for this operation.

Returns
The current write_concern.
See also
https://docs.mongodb.com/manual/core/write-concern/

◆ write_concern() [2/2]

bulk_write& mongocxx::options::bulk_write::write_concern ( class write_concern  wc)

Sets the write_concern for this operation.

Parameters
wcThe new write_concern.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/manual/core/write-concern/

The documentation for this class was generated from the following file: