MongoDB C++ Driver mongocxx-4.0.0
|
#include <mongocxx/v_noabi/mongocxx/options/update.hpp>
Class representing the optional arguments to a MongoDB update operation.
Public Member Functions | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::array::view_or_value > & | array_filters () const |
Get array filters for this operation. | |
update & | array_filters (bsoncxx::v_noabi::array::view_or_value array_filters) |
Set array filters for this operation. | |
const bsoncxx::v_noabi::stdx::optional< bool > & | bypass_document_validation () const |
Gets the current value of the bypass_document_validation option. | |
update & | 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. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > & | collation () const |
Retrieves the current collation for this operation. | |
update & | collation (bsoncxx::v_noabi::document::view_or_value collation) |
Sets the collation for this operation. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > | comment () const |
Gets the current value of the comment option. | |
update & | comment (bsoncxx::v_noabi::types::bson_value::view_or_value comment) |
Set the value of the comment option. | |
const bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::hint > & | hint () const |
Gets the current hint. | |
update & | hint (mongocxx::v_noabi::hint index_hint) |
Sets the index to use for this operation. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > | let () const |
Gets the current value of the let option. | |
update & | let (bsoncxx::v_noabi::document::view_or_value let) |
Set the value of the let option. | |
const bsoncxx::v_noabi::stdx::optional< bool > & | upsert () const |
Gets the current value of the upsert option. | |
update & | upsert (bool upsert) |
Sets the upsert option. | |
const bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::write_concern > & | write_concern () const |
The current write_concern for this operation. | |
update & | write_concern (mongocxx::v_noabi::write_concern wc) |
Sets the write_concern for this operation. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::array::view_or_value > & mongocxx::v_noabi::options::update::array_filters | ( | ) | const |
Get array filters for this operation.
update & mongocxx::v_noabi::options::update::array_filters | ( | bsoncxx::v_noabi::array::view_or_value | array_filters | ) |
Set array filters for this operation.
array_filters | Array representing filters determining which array elements to modify. |
const bsoncxx::v_noabi::stdx::optional< bool > & mongocxx::v_noabi::options::update::bypass_document_validation | ( | ) | const |
Gets the current value of the bypass_document_validation option.
update & mongocxx::v_noabi::options::update::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 bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > & mongocxx::v_noabi::options::update::collation | ( | ) | const |
Retrieves the current collation for this operation.
update & mongocxx::v_noabi::options::update::collation | ( | bsoncxx::v_noabi::document::view_or_value | collation | ) |
Sets the collation for this operation.
collation | The new collation. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > mongocxx::v_noabi::options::update::comment | ( | ) | const |
Gets the current value of the comment option.
update & mongocxx::v_noabi::options::update::comment | ( | bsoncxx::v_noabi::types::bson_value::view_or_value | comment | ) |
Set the value of the comment option.
comment | The new comment option. |
const bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::hint > & mongocxx::v_noabi::options::update::hint | ( | ) | const |
Gets the current hint.
update & mongocxx::v_noabi::options::update::hint | ( | mongocxx::v_noabi::hint | index_hint | ) |
Sets the index to use for this operation.
index_hint | Object representing the index to use. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > mongocxx::v_noabi::options::update::let | ( | ) | const |
Gets the current value of the let option.
update & mongocxx::v_noabi::options::update::let | ( | bsoncxx::v_noabi::document::view_or_value | let | ) |
Set the value of the let option.
let | The new let option. |
const bsoncxx::v_noabi::stdx::optional< bool > & mongocxx::v_noabi::options::update::upsert | ( | ) | const |
Gets the current value of the upsert option.
update & mongocxx::v_noabi::options::update::upsert | ( | bool | upsert | ) |
Sets the upsert option.
By default, if no document matches the filter, the update operation does nothing. However, by specifying upsert as true
, this operation either updates matching documents or inserts a new document using the update 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 bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::write_concern > & mongocxx::v_noabi::options::update::write_concern | ( | ) | const |
The current write_concern for this operation.
update & mongocxx::v_noabi::options::update::write_concern | ( | mongocxx::v_noabi::write_concern | wc | ) |
Sets the write_concern for this operation.
wc | The new write_concern |