MongoDB C++ Driver
mongocxx-3.0.2
|
Class representing the optional arguments to a MongoDB find_and_modify update operation. More...
#include <find_one_and_update.hpp>
Public Member Functions | |
find_one_and_update & | bypass_document_validation (bool bypass_document_validation) |
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. More... | |
find_one_and_update & | max_time (std::chrono::milliseconds max_time) |
Sets the maximum amount of time for this operation to run (server-side) in milliseconds. More... | |
const stdx::optional< std::chrono::milliseconds > & | max_time () const |
The current max_time setting. More... | |
find_one_and_update & | projection (bsoncxx::document::view_or_value projection) |
Sets a projection, which limits the fields to return. More... | |
const stdx::optional< bsoncxx::document::view_or_value > & | projection () const |
Gets the current projection for this operation. More... | |
find_one_and_update & | return_document (return_document return_document) |
Set the desired version of the updated document to return, either the original document, or the updated. More... | |
const stdx::optional< mongocxx::options::return_document > & | return_document () const |
Which version of the updated document to return. More... | |
find_one_and_update & | sort (bsoncxx::document::view_or_value ordering) |
Sets the order by which to search the collection for a matching document. More... | |
const stdx::optional< bsoncxx::document::view_or_value > & | sort () const |
Gets the current sort ordering. More... | |
find_one_and_update & | upsert (bool upsert) |
Sets the upsert flag on the operation. More... | |
const stdx::optional< bool > & | upsert () const |
Gets the current upsert setting. More... | |
Class representing the optional arguments to a MongoDB find_and_modify update operation.
find_one_and_update& mongocxx::options::find_one_and_update::bypass_document_validation | ( | bool | bypass_document_validation | ) |
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::find_one_and_update::bypass_document_validation | ( | ) | const |
The current setting for bypassing document validation.
find_one_and_update& mongocxx::options::find_one_and_update::max_time | ( | std::chrono::milliseconds | max_time | ) |
Sets the maximum amount of time for this operation to run (server-side) in milliseconds.
max_time | The max amount of time (in milliseconds). |
const stdx::optional<std::chrono::milliseconds>& mongocxx::options::find_one_and_update::max_time | ( | ) | const |
The current max_time setting.
find_one_and_update& mongocxx::options::find_one_and_update::projection | ( | bsoncxx::document::view_or_value | projection | ) |
Sets a projection, which limits the fields to return.
projection | The projection document. |
const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::find_one_and_update::projection | ( | ) | const |
Gets the current projection for this operation.
find_one_and_update& mongocxx::options::find_one_and_update::return_document | ( | return_document | return_document | ) |
Set the desired version of the updated document to return, either the original document, or the updated.
By default, the original document is returned.
return_document | Version of document to return, either original or updated. |
const stdx::optional<mongocxx::options::return_document>& mongocxx::options::find_one_and_update::return_document | ( | ) | const |
Which version of the updated document to return.
find_one_and_update& mongocxx::options::find_one_and_update::sort | ( | bsoncxx::document::view_or_value | ordering | ) |
Sets the order by which to search the collection for a matching document.
ordering | Document describing the order of the documents to be returned. |
const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::find_one_and_update::sort | ( | ) | const |
Gets the current sort ordering.
find_one_and_update& mongocxx::options::find_one_and_update::upsert | ( | bool | upsert | ) |
Sets the upsert flag on the operation.
When true
, the operation creates a new document if no document matches the filter. When false
, this operation will do nothing if there are no matching documents. The server-side default is false.
upsert | Whether or not to perform an upsert. |
const stdx::optional<bool>& mongocxx::options::find_one_and_update::upsert | ( | ) | const |
Gets the current upsert setting.