MongoDB C++ Driver mongocxx-3.0.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mongocxx::options::count Class Reference

Class representing the optional arguments to a MongoDB count command. More...

#include <count.hpp>

Public Member Functions

counthint (class hint index_hint)
 Sets the index to use for this operation.
 
const stdx::optional< class hint > & hint () const
 Gets the current hint.
 
countlimit (std::int64_t limit)
 Sets the maximum number of documents to count.
 
const stdx::optional< std::int64_t > & limit () const
 Gets the current limit.
 
countmax_time (std::chrono::milliseconds max_time)
 Sets the maximum amount of time for this operation to run (server-side) in milliseconds.
 
const stdx::optional< std::chrono::milliseconds > & max_time () const
 The current max_time setting.
 
countskip (std::int64_t skip)
 Sets the number of documents to skip before counting documents.
 
const stdx::optional< std::int64_t > & skip () const
 Gets the current number of documents to skip.
 
countread_preference (class read_preference rp)
 Sets the read_preference for this operation.
 
const stdx::optional< class read_preference > & read_preference () const
 The current read_preference for this operation.
 

Detailed Description

Class representing the optional arguments to a MongoDB count command.

Member Function Documentation

◆ hint() [1/2]

const stdx::optional< class hint > & mongocxx::options::count::hint ( ) const

Gets the current hint.

Returns
The current hint, if one is set.

◆ hint() [2/2]

count & mongocxx::options::count::hint ( class hint  index_hint)

Sets the index to use for this operation.

Parameters
index_hintObject representing the index to use.

◆ limit() [1/2]

const stdx::optional< std::int64_t > & mongocxx::options::count::limit ( ) const

Gets the current limit.

Returns
The current limit.

◆ limit() [2/2]

count & mongocxx::options::count::limit ( std::int64_t  limit)

Sets the maximum number of documents to count.

Parameters
limitThe max number of documents to count.

◆ max_time() [1/2]

const stdx::optional< std::chrono::milliseconds > & mongocxx::options::count::max_time ( ) const

The current max_time setting.

Returns
The current max time (in milliseconds).
See also
http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS

◆ max_time() [2/2]

count & mongocxx::options::count::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 time (in milliseconds).
See also
http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS

◆ read_preference() [1/2]

const stdx::optional< class read_preference > & mongocxx::options::count::read_preference ( ) const

The current read_preference for this operation.

Returns
the current read_preference
See also
http://docs.mongodb.org/manual/core/read-preference/

◆ read_preference() [2/2]

count & mongocxx::options::count::read_preference ( class read_preference  rp)

Sets the read_preference for this operation.

Parameters
rpThe new read_preference.
See also
http://docs.mongodb.org/manual/core/read-preference/

◆ skip() [1/2]

const stdx::optional< std::int64_t > & mongocxx::options::count::skip ( ) const

Gets the current number of documents to skip.

Returns
The number of documents to skip.
See also
http://docs.mongodb.org/manual/reference/method/cursor.skip/

◆ skip() [2/2]

count & mongocxx::options::count::skip ( std::int64_t  skip)

Sets the number of documents to skip before counting documents.

Parameters
skipThe number of documents to skip.
See also
http://docs.mongodb.org/manual/reference/method/cursor.skip/

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