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

Class representing the optional arguments to a MongoDB find_and_modify delete operation. More...

#include <find_one_and_delete.hpp>

Public Member Functions

find_one_and_deletecollation (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...
 
find_one_and_deletemax_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_deleteprojection (bsoncxx::document::view_or_value projection)
 Sets a projection that limits the fields to return. More...
 
const stdx::optional< bsoncxx::document::view_or_value > & projection () const
 Gets the current projection set on this operation. More...
 
find_one_and_deletesort (bsoncxx::document::view_or_value ordering)
 Sets the order to search for a matching document. More...
 
const stdx::optional< bsoncxx::document::view_or_value > & sort () const
 Gets the current sort ordering. More...
 

Detailed Description

Class representing the optional arguments to a MongoDB find_and_modify delete operation.

Member Function Documentation

find_one_and_delete& mongocxx::options::find_one_and_delete::collation ( bsoncxx::document::view_or_value  collation)

Sets the collation for this operation.

Parameters
collationThe new collation.
See also
https://docs.mongodb.com/master/reference/collation/
const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::find_one_and_delete::collation ( ) const

Retrieves the current collation for this operation.

Returns
The current collation.
See also
https://docs.mongodb.com/master/reference/collation/
find_one_and_delete& mongocxx::options::find_one_and_delete::max_time ( std::chrono::milliseconds  max_time)

Sets the maximum amount of time for this operation to run (server-side) in milliseconds.

Parameters
max_timeThe max amount of running time (in milliseconds).
See also
https://docs.mongodb.com/master/reference/operator/meta/maxTimeMS
const stdx::optional<std::chrono::milliseconds>& mongocxx::options::find_one_and_delete::max_time ( ) const

The current max_time setting.

Returns
the current max time (in milliseconds).
See also
https://docs.mongodb.com/master/reference/operator/meta/maxTimeMS
find_one_and_delete& mongocxx::options::find_one_and_delete::projection ( bsoncxx::document::view_or_value  projection)

Sets a projection that limits the fields to return.

Parameters
projectionThe projection document.
See also
https://docs.mongodb.com/master/tutorial/project-fields-from-query-results/
const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::find_one_and_delete::projection ( ) const

Gets the current projection set on this operation.

Returns
The current projection.
See also
https://docs.mongodb.com/master/tutorial/project-fields-from-query-results/
find_one_and_delete& mongocxx::options::find_one_and_delete::sort ( bsoncxx::document::view_or_value  ordering)

Sets the order to search for a matching document.

Warning
This can influence which document the operation modifies if the provided filter selects multiple documents.
Parameters
orderingDocument describing the order of the documents to be returned.
See also
https://docs.mongodb.com/master/reference/method/db.collection.findAndModify/
const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::find_one_and_delete::sort ( ) const

Gets the current sort ordering.

Returns
The current sort ordering.
See also
https://docs.mongodb.com/master/reference/method/db.collection.findAndModify/

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