MongoDB C++ Driver
mongocxx-3.7.0
|
Class representing the optional arguments to a MongoDB replace operation. More...
#include <replace.hpp>
Public Member Functions | |
replace & | bypass_document_validation (bool bypass_document_validation) |
Sets the bypass_document_validation option. More... | |
const stdx::optional< bool > & | bypass_document_validation () const |
Gets the current value of the bypass_document_validation option. More... | |
replace & | collation (bsoncxx::document::view_or_value collation) |
Sets the collation for this operation. More... | |
const stdx::optional< bsoncxx::document::view_or_value > & | collation () const |
Retrieves the current collation for this operation. More... | |
replace & | upsert (bool upsert) |
Sets the upsert option. More... | |
const stdx::optional< bool > & | upsert () const |
Gets the current value of the upsert option. More... | |
replace & | 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... | |
replace & | hint (class hint index_hint) |
Sets the index to use for this operation. More... | |
const stdx::optional< class hint > & | hint () const |
Gets the current hint. More... | |
replace & | let (bsoncxx::document::view_or_value let) |
Set the value of the let option. More... | |
const stdx::optional< bsoncxx::document::view_or_value > | let () const |
Gets the current value of the let option. More... | |
replace & | comment (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_value > | comment () const |
Gets the current value of the comment option. More... | |
Class representing the optional arguments to a MongoDB replace operation.
const stdx::optional<bool>& mongocxx::options::replace::bypass_document_validation | ( | ) | const |
Gets the current value of the bypass_document_validation option.
replace& mongocxx::options::replace::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.
bypass_document_validation | Whether or not to bypass document validation |
const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::replace::collation | ( | ) | const |
Retrieves the current collation for this operation.
replace& mongocxx::options::replace::collation | ( | bsoncxx::document::view_or_value | collation | ) |
Sets the collation for this operation.
collation | The new collation. |
const stdx::optional<bsoncxx::types::bson_value::view_or_value> mongocxx::options::replace::comment | ( | ) | const |
Gets the current value of the comment option.
replace& mongocxx::options::replace::comment | ( | bsoncxx::types::bson_value::view_or_value | comment | ) |
Set the value of the comment option.
comment | The new comment option. |
const stdx::optional<class hint>& mongocxx::options::replace::hint | ( | ) | const |
Gets the current hint.
Sets the index to use for this operation.
index_hint | Object representing the index to use. |
const stdx::optional<bsoncxx::document::view_or_value> mongocxx::options::replace::let | ( | ) | const |
Gets the current value of the let option.
replace& mongocxx::options::replace::let | ( | bsoncxx::document::view_or_value | let | ) |
Set the value of the let option.
let | The new let option. |
const stdx::optional<bool>& mongocxx::options::replace::upsert | ( | ) | const |
Gets the current value of the upsert option.
replace& mongocxx::options::replace::upsert | ( | bool | upsert | ) |
Sets the upsert option.
By default, if no document matches the filter, the replace operation does nothing. However, by specifying upsert as true
, this operation either updates matching documents or inserts a new document using the replace specification if no matching document exists.
upsert | If set to true , creates a new document when no document matches the query criteria. The server-side default is false , which does not insert a new document if a match is not found. |
const stdx::optional<class write_concern>& mongocxx::options::replace::write_concern | ( | ) | const |
The current write_concern for this operation.
replace& mongocxx::options::replace::write_concern | ( | class write_concern | wc | ) |
Sets the write_concern for this operation.
wc | The new write_concern |