MongoDB C++ Driver 4.4.0
Loading...
Searching...
No Matches
mongocxx::v1::count_options Class Reference

#include <mongocxx/v1/count_options.hpp>

Description

Options for a "countDocuments" operation.

Supported fields include:

See also

Public Member Functions

 count_options ()
 Default initialization.
 count_options (count_options &&other) noexcept
 Move constructor.
 count_options (count_options const &other)
 Copy construction.
 ~count_options ()
 Destroy this object.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::viewcollation () const
 Return the current "collation" field.
count_optionscollation (bsoncxx::v1::document::value v)
 Set the "collation" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::types::viewcomment () const
 Return the current "comment" field.
count_optionscomment (bsoncxx::v1::types::value v)
 Set the "comment" field.
bsoncxx::v1::stdx::optional< v1::hinthint () const
 Return the current "hint" field.
count_optionshint (v1::hint v)
 Set the "hint" field.
bsoncxx::v1::stdx::optional< std::int64_t > limit () const
 Return the current "limit" field.
count_optionslimit (std::int64_t v)
 Set the "limit" field.
bsoncxx::v1::stdx::optional< std::chrono::milliseconds > max_time () const
 Return the current "maxTimeMS" field.
count_optionsmax_time (std::chrono::milliseconds v)
 Set the "maxTimeMS" field.
count_optionsoperator= (count_options &&other) noexcept
 Move assignment.
count_optionsoperator= (count_options const &other)
 Copy assignment.
bsoncxx::v1::stdx::optional< v1::read_concernread_concern () const
 Return the current "readConcern" field.
count_optionsread_concern (v1::read_concern v)
 Set the "readConcern" field.
bsoncxx::v1::stdx::optional< v1::read_preferenceread_preference () const
 Return the current "readPreference" field.
count_optionsread_preference (v1::read_preference v)
 Set the "readPreference" field.
bsoncxx::v1::stdx::optional< std::int64_t > skip () const
 Return the current "skip" field.
count_optionsskip (std::int64_t v)
 Set the "skip" field.

Constructor & Destructor Documentation

◆ ~count_options()

mongocxx::v1::count_options::~count_options ( )

Destroy this object.

Warning
Invalidates all associated views.

◆ count_options() [1/3]

mongocxx::v1::count_options::count_options ( count_options && other)
noexcept

Move constructor.

Postconditions:
  • other is in an assign-or-destroy-only state.

◆ count_options() [2/3]

mongocxx::v1::count_options::count_options ( count_options const & other)

Copy construction.

◆ count_options() [3/3]

mongocxx::v1::count_options::count_options ( )

Default initialization.

Postconditions:
  • All supported fields are "unset" or zero-initialized.

Member Function Documentation

◆ collation() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > mongocxx::v1::count_options::collation ( ) const

Return the current "collation" field.

◆ collation() [2/2]

count_options & mongocxx::v1::count_options::collation ( bsoncxx::v1::document::value v)

Set the "collation" field.

◆ comment() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::types::view > mongocxx::v1::count_options::comment ( ) const

Return the current "comment" field.

◆ comment() [2/2]

count_options & mongocxx::v1::count_options::comment ( bsoncxx::v1::types::value v)

Set the "comment" field.

◆ hint() [1/2]

bsoncxx::v1::stdx::optional< v1::hint > mongocxx::v1::count_options::hint ( ) const

Return the current "hint" field.

◆ hint() [2/2]

count_options & mongocxx::v1::count_options::hint ( v1::hint v)

Set the "hint" field.

◆ limit() [1/2]

bsoncxx::v1::stdx::optional< std::int64_t > mongocxx::v1::count_options::limit ( ) const

Return the current "limit" field.

◆ limit() [2/2]

count_options & mongocxx::v1::count_options::limit ( std::int64_t v)

Set the "limit" field.

◆ max_time() [1/2]

bsoncxx::v1::stdx::optional< std::chrono::milliseconds > mongocxx::v1::count_options::max_time ( ) const

Return the current "maxTimeMS" field.

◆ max_time() [2/2]

count_options & mongocxx::v1::count_options::max_time ( std::chrono::milliseconds v)

Set the "maxTimeMS" field.

◆ operator=() [1/2]

count_options & mongocxx::v1::count_options::operator= ( count_options && other)
noexcept

Move assignment.

Postconditions:
  • other is in an assign-or-destroy-only state.

◆ operator=() [2/2]

count_options & mongocxx::v1::count_options::operator= ( count_options const & other)

Copy assignment.

◆ read_concern() [1/2]

bsoncxx::v1::stdx::optional< v1::read_concern > mongocxx::v1::count_options::read_concern ( ) const

Return the current "readConcern" field.

◆ read_concern() [2/2]

count_options & mongocxx::v1::count_options::read_concern ( v1::read_concern v)

Set the "readConcern" field.

◆ read_preference() [1/2]

bsoncxx::v1::stdx::optional< v1::read_preference > mongocxx::v1::count_options::read_preference ( ) const

Return the current "readPreference" field.

◆ read_preference() [2/2]

count_options & mongocxx::v1::count_options::read_preference ( v1::read_preference v)

Set the "readPreference" field.

◆ skip() [1/2]

bsoncxx::v1::stdx::optional< std::int64_t > mongocxx::v1::count_options::skip ( ) const

Return the current "skip" field.

◆ skip() [2/2]

count_options & mongocxx::v1::count_options::skip ( std::int64_t v)

Set the "skip" field.


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