MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
mongocxx::v1::find_options Class Reference

#include <mongocxx/v1/find_options.hpp>

Description

Options for a "find" command.

Supported fields include:

See also
Attention
This feature is experimental! It is not ready for use!

Public Member Functions

 find_options ()
 Default initialization.
 find_options (find_options &&other) noexcept
 Move constructor.
 find_options (find_options const &other)
 Copy construction.
 ~find_options ()
 Destroy this object.
bsoncxx::v1::stdx::optional< bool > allow_disk_use () const
 Return the current "allowDiskUse" field.
find_optionsallow_disk_use (bool allow_disk_use)
 Set the "allowDiskUse" field.
bsoncxx::v1::stdx::optional< bool > allow_partial_results () const
 Return the current "allowPartialResults" field.
find_optionsallow_partial_results (bool allow_partial)
 Set the "allowPartialResults" field.
bsoncxx::v1::stdx::optional< std::int32_t > batch_size () const
 Return the current "batchSize" field.
find_optionsbatch_size (std::int32_t batch_size)
 Set the "batchSize" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::viewcollation () const
 Return the current "collation" field.
find_optionscollation (bsoncxx::v1::document::value collation)
 Set the "collation" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::types::viewcomment () const
 Return the current "comment" field.
find_optionscomment (bsoncxx::v1::types::value comment)
 Set the "comment" field.
bsoncxx::v1::stdx::optional< cursor::typecursor_type () const
 Return the current "cursorType" field.
find_optionscursor_type (v1::cursor::type cursor_type)
 Set the "cursorType" field.
bsoncxx::v1::stdx::optional< v1::hinthint () const
 Return the current "hint" field.
find_optionshint (v1::hint index_hint)
 Set the "hint" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > const let () const
 Return the current "let" field.
find_optionslet (bsoncxx::v1::document::value let)
 Set the "let" field.
bsoncxx::v1::stdx::optional< std::int64_t > limit () const
 Return the current "limit" field.
find_optionslimit (std::int64_t limit)
 Set the "limit" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::viewmax () const
 Return the current "max" field.
find_optionsmax (bsoncxx::v1::document::value max)
 Set the "max" field.
bsoncxx::v1::stdx::optional< std::chrono::milliseconds > max_await_time () const
 Return the current "maxAwaitTimeMS" field.
find_optionsmax_await_time (std::chrono::milliseconds max_await_time)
 Set the "maxAwaitTimeMS" field.
bsoncxx::v1::stdx::optional< std::chrono::milliseconds > max_time () const
 Return the current "maxTimeMS" field.
find_optionsmax_time (std::chrono::milliseconds max_time)
 Set the "maxTimeMS" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::viewmin () const
 Return the current "min" field.
find_optionsmin (bsoncxx::v1::document::value min)
 Set the "min" field.
bsoncxx::v1::stdx::optional< bool > no_cursor_timeout () const
 Return the current "noCursorTimeout" field.
find_optionsno_cursor_timeout (bool no_cursor_timeout)
 Set the "noCursorTimeout" field.
find_optionsoperator= (find_options &&other) noexcept
 Move assignment.
find_optionsoperator= (find_options const &other)
 Copy assignment.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::viewprojection () const
 Return the current "projection" field.
find_optionsprojection (bsoncxx::v1::document::value projection)
 Set the "projection" field.
bsoncxx::v1::stdx::optional< v1::read_preferenceread_preference () const
 Return the current "readPreference" field.
find_optionsread_preference (v1::read_preference rp)
 Set the "readPreference" field.
bsoncxx::v1::stdx::optional< bool > return_key () const
 Return the current "returnKey" field.
find_optionsreturn_key (bool return_key)
 Set the "returnKey" field.
bsoncxx::v1::stdx::optional< bool > show_record_id () const
 Return the current "showRecordId" field.
find_optionsshow_record_id (bool show_record_id)
 Set the "showRecordId" field.
bsoncxx::v1::stdx::optional< std::int64_t > skip () const
 Return the current "skip" field.
find_optionsskip (std::int64_t skip)
 Set the "skip" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::viewsort () const
 Return the current "sort" field.
find_optionssort (bsoncxx::v1::document::value ordering)
 Set the "sort" field.

Constructor & Destructor Documentation

◆ ~find_options()

mongocxx::v1::find_options::~find_options ( )

Destroy this object.

Warning
Invalidates all associated views.

◆ find_options() [1/3]

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

Move constructor.

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

◆ find_options() [2/3]

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

Copy construction.

◆ find_options() [3/3]

mongocxx::v1::find_options::find_options ( )

Default initialization.

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

Member Function Documentation

◆ allow_disk_use() [1/2]

bsoncxx::v1::stdx::optional< bool > mongocxx::v1::find_options::allow_disk_use ( ) const

Return the current "allowDiskUse" field.

◆ allow_disk_use() [2/2]

find_options & mongocxx::v1::find_options::allow_disk_use ( bool allow_disk_use)

Set the "allowDiskUse" field.

◆ allow_partial_results() [1/2]

bsoncxx::v1::stdx::optional< bool > mongocxx::v1::find_options::allow_partial_results ( ) const

Return the current "allowPartialResults" field.

◆ allow_partial_results() [2/2]

find_options & mongocxx::v1::find_options::allow_partial_results ( bool allow_partial)

Set the "allowPartialResults" field.

◆ batch_size() [1/2]

bsoncxx::v1::stdx::optional< std::int32_t > mongocxx::v1::find_options::batch_size ( ) const

Return the current "batchSize" field.

◆ batch_size() [2/2]

find_options & mongocxx::v1::find_options::batch_size ( std::int32_t batch_size)

Set the "batchSize" field.

◆ collation() [1/2]

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

Return the current "collation" field.

◆ collation() [2/2]

find_options & mongocxx::v1::find_options::collation ( bsoncxx::v1::document::value collation)

Set the "collation" field.

◆ comment() [1/2]

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

Return the current "comment" field.

◆ comment() [2/2]

find_options & mongocxx::v1::find_options::comment ( bsoncxx::v1::types::value comment)

Set the "comment" field.

◆ cursor_type() [1/2]

bsoncxx::v1::stdx::optional< cursor::type > mongocxx::v1::find_options::cursor_type ( ) const

Return the current "cursorType" field.

◆ cursor_type() [2/2]

find_options & mongocxx::v1::find_options::cursor_type ( v1::cursor::type cursor_type)

Set the "cursorType" field.

◆ hint() [1/2]

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

Return the current "hint" field.

◆ hint() [2/2]

find_options & mongocxx::v1::find_options::hint ( v1::hint index_hint)

Set the "hint" field.

◆ let() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > const mongocxx::v1::find_options::let ( ) const

Return the current "let" field.

◆ let() [2/2]

find_options & mongocxx::v1::find_options::let ( bsoncxx::v1::document::value let)

Set the "let" field.

◆ limit() [1/2]

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

Return the current "limit" field.

◆ limit() [2/2]

find_options & mongocxx::v1::find_options::limit ( std::int64_t limit)

Set the "limit" field.

◆ max() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > mongocxx::v1::find_options::max ( ) const

Return the current "max" field.

◆ max() [2/2]

find_options & mongocxx::v1::find_options::max ( bsoncxx::v1::document::value max)

Set the "max" field.

◆ max_await_time() [1/2]

bsoncxx::v1::stdx::optional< std::chrono::milliseconds > mongocxx::v1::find_options::max_await_time ( ) const

Return the current "maxAwaitTimeMS" field.

◆ max_await_time() [2/2]

find_options & mongocxx::v1::find_options::max_await_time ( std::chrono::milliseconds max_await_time)

Set the "maxAwaitTimeMS" field.

◆ max_time() [1/2]

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

Return the current "maxTimeMS" field.

◆ max_time() [2/2]

find_options & mongocxx::v1::find_options::max_time ( std::chrono::milliseconds max_time)

Set the "maxTimeMS" field.

◆ min() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > mongocxx::v1::find_options::min ( ) const

Return the current "min" field.

◆ min() [2/2]

find_options & mongocxx::v1::find_options::min ( bsoncxx::v1::document::value min)

Set the "min" field.

◆ no_cursor_timeout() [1/2]

bsoncxx::v1::stdx::optional< bool > mongocxx::v1::find_options::no_cursor_timeout ( ) const

Return the current "noCursorTimeout" field.

◆ no_cursor_timeout() [2/2]

find_options & mongocxx::v1::find_options::no_cursor_timeout ( bool no_cursor_timeout)

Set the "noCursorTimeout" field.

◆ operator=() [1/2]

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

Move assignment.

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

◆ operator=() [2/2]

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

Copy assignment.

◆ projection() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > mongocxx::v1::find_options::projection ( ) const

Return the current "projection" field.

◆ projection() [2/2]

find_options & mongocxx::v1::find_options::projection ( bsoncxx::v1::document::value projection)

Set the "projection" field.

◆ read_preference() [1/2]

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

Return the current "readPreference" field.

◆ read_preference() [2/2]

find_options & mongocxx::v1::find_options::read_preference ( v1::read_preference rp)

Set the "readPreference" field.

◆ return_key() [1/2]

bsoncxx::v1::stdx::optional< bool > mongocxx::v1::find_options::return_key ( ) const

Return the current "returnKey" field.

◆ return_key() [2/2]

find_options & mongocxx::v1::find_options::return_key ( bool return_key)

Set the "returnKey" field.

◆ show_record_id() [1/2]

bsoncxx::v1::stdx::optional< bool > mongocxx::v1::find_options::show_record_id ( ) const

Return the current "showRecordId" field.

◆ show_record_id() [2/2]

find_options & mongocxx::v1::find_options::show_record_id ( bool show_record_id)

Set the "showRecordId" field.

◆ skip() [1/2]

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

Return the current "skip" field.

◆ skip() [2/2]

find_options & mongocxx::v1::find_options::skip ( std::int64_t skip)

Set the "skip" field.

◆ sort() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > mongocxx::v1::find_options::sort ( ) const

Return the current "sort" field.

◆ sort() [2/2]

find_options & mongocxx::v1::find_options::sort ( bsoncxx::v1::document::value ordering)

Set the "sort" field.


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