MongoDB C++ Driver mongocxx-3.10.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mongocxx::v_noabi::options::insert Class Reference

Class representing the optional arguments to a MongoDB insert operation. More...

#include <insert.hpp>

Public Member Functions

insertbypass_document_validation (bool bypass_document_validation)
 Sets the bypass_document_validation option.
 
const stdx::optional< bool > & bypass_document_validation () const
 Gets the current value of the bypass_document_validation option.
 
insertwrite_concern (mongocxx::v_noabi::write_concern wc)
 Sets the write_concern for this operation.
 
const stdx::optional< mongocxx::v_noabi::write_concern > & write_concern () const
 The current write_concern for this operation.
 
insertordered (bool ordered)
 
const stdx::optional< bool > & ordered () const
 The current ordered value for this operation.
 
insertcomment (bsoncxx::v_noabi::types::bson_value::view_or_value comment)
 Sets the comment for this operation.
 
const stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > & comment () const
 The current comment for this operation.
 

Detailed Description

Class representing the optional arguments to a MongoDB insert operation.

Member Function Documentation

◆ bypass_document_validation() [1/2]

const stdx::optional< bool > & mongocxx::v_noabi::options::insert::bypass_document_validation ( ) const

Gets the current value of the bypass_document_validation option.

Returns
The optional value of the bypass_document_validation option.

◆ bypass_document_validation() [2/2]

insert & mongocxx::v_noabi::options::insert::bypass_document_validation ( bool  bypass_document_validation)

Sets the bypass_document_validation option.

If true, allows the write to opt-out of document level validation.

Note
On servers >= 3.2, the server applies validation by default. On servers < 3.2, this option is ignored.
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::v_noabi::types::bson_value::view_or_value > & mongocxx::v_noabi::options::insert::comment ( ) const

The current comment for this operation.

Returns
The current comment.
See also
https://www.mongodb.com/docs/manual/reference/command/insert/

◆ comment() [2/2]

insert & mongocxx::v_noabi::options::insert::comment ( bsoncxx::v_noabi::types::bson_value::view_or_value  comment)

Sets the comment for this operation.

Parameters
commentThe new comment.
See also
https://www.mongodb.com/docs/manual/reference/command/insert/
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ ordered() [1/2]

const stdx::optional< bool > & mongocxx::v_noabi::options::insert::ordered ( ) const

The current ordered value for this operation.

Returns
The current ordered value.
See also
https://www.mongodb.com/docs/manual/reference/command/insert/

◆ ordered() [2/2]

insert & mongocxx::v_noabi::options::insert::ordered ( bool  ordered)
Note
: This applies only to insert_many and is ignored for insert_one.

If true, when an insert fails, return without performing the remaining writes. If false, when a write fails, continue with the remaining writes, if any. Inserts can be performed in any order if this is false. Defaults to true.

Parameters
orderedWhether or not the insert_many will be ordered.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://www.mongodb.com/docs/manual/reference/command/insert/

◆ write_concern() [1/2]

const stdx::optional< mongocxx::v_noabi::write_concern > & mongocxx::v_noabi::options::insert::write_concern ( ) const

The current write_concern for this operation.

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

◆ write_concern() [2/2]

insert & mongocxx::v_noabi::options::insert::write_concern ( mongocxx::v_noabi::write_concern  wc)

Sets the write_concern for this operation.

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

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