MongoDB C++ Driver  mongocxx-3.4.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...
 
find_one_and_deletewrite_concern (mongocxx::write_concern write_concern)
 Sets the write concern for this operation. More...
 
const stdx::optional< mongocxx::write_concern > & write_concern () const
 Gets the current write concern. More...
 

Detailed Description

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

Member Function Documentation

◆ collation() [1/2]

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.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/master/reference/command/findAndModify/

◆ collation() [2/2]

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/command/findAndModify/

◆ max_time() [1/2]

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).
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/master/reference/command/findAndModify/

◆ max_time() [2/2]

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/command/findAndModify/

◆ projection() [1/2]

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.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/master/reference/command/findAndModify/

◆ projection() [2/2]

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/reference/command/findAndModify/

◆ sort() [1/2]

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.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/master/reference/command/findAndModify/

◆ sort() [2/2]

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/command/findAndModify/

◆ write_concern() [1/2]

find_one_and_delete& mongocxx::options::find_one_and_delete::write_concern ( mongocxx::write_concern  write_concern)

Sets the write concern for this operation.

Parameters
write_concernObject representing the write concern.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/master/reference/command/findAndModify/

◆ write_concern() [2/2]

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

Gets the current write concern.

Returns
The current write concern.
See also
https://docs.mongodb.com/master/reference/command/findAndModify/

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