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:

- allow_disk_use ("allowDiskUse")
- allow_partial_results ("allowPartialResults")
- batch_size ("batchSize")
- collation
- comment
- cursor_type ("cursorType")
- hint
- let
- limit
- max_await_time ("maxAwaitTimeMS")
- max_time ("maxTimeMS")
- max
- min
- no_cursor_timeout ("noCursorTimeout")
- projection
- read_preference ("readPreference")
- read_concern ("readConcern")
- return_key ("returnKey")
- show_record_id ("showRecordId")
- skip
- sort

See also
  - find (database command) (MongoDB Manual)

## 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_options & | allow_disk_use (bool v)
| Set the "allowDiskUse" field.
bsoncxx::v1::stdx::optional< bool > | allow_partial_results () const
| Return the current "allowPartialResults" field.
find_options & | allow_partial_results (bool v)
| Set the "allowPartialResults" field.
bsoncxx::v1::stdx::optional< std::int32_t > | batch_size () const
| Return the current "batchSize" field.
find_options & | batch_size (std::int32_t v)
| Set the "batchSize" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > | collation () const
| Return the current "collation" field.
find_options & | collation (bsoncxx::v1::document::value v)
| Set the "collation" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::types::view > | comment () const
| Return the current "comment" field.
find_options & | comment (bsoncxx::v1::types::value v)
| Set the "comment" field.
bsoncxx::v1::stdx::optional< cursor::type > | cursor_type () const
| Return the current "cursorType" field.
find_options & | cursor_type (v1::cursor::type v)
| Set the "cursorType" field.
bsoncxx::v1::stdx::optional< v1::hint > | hint () const
| Return the current "hint" field.
find_options & | hint (v1::hint v)
| Set the "hint" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > const | let () const
| Return the current "let" field.
find_options & | let (bsoncxx::v1::document::value v)
| Set the "let" field.
bsoncxx::v1::stdx::optional< std::int64_t > | limit () const
| Return the current "limit" field.
find_options & | limit (std::int64_t v)
| Set the "limit" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > | max () const
| Return the current "max" field.
find_options & | max (bsoncxx::v1::document::value v)
| Set the "max" field.
bsoncxx::v1::stdx::optional< std::chrono::milliseconds > | max_await_time () const
| Return the current "maxAwaitTimeMS" field.
find_options & | max_await_time (std::chrono::milliseconds v)
| Set the "maxAwaitTimeMS" field.
bsoncxx::v1::stdx::optional< std::chrono::milliseconds > | max_time () const
| Return the current "maxTimeMS" field.
find_options & | max_time (std::chrono::milliseconds v)
| Set the "maxTimeMS" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > | min () const
| Return the current "min" field.
find_options & | min (bsoncxx::v1::document::value v)
| Set the "min" field.
bsoncxx::v1::stdx::optional< bool > | no_cursor_timeout () const
| Return the current "noCursorTimeout" field.
find_options & | no_cursor_timeout (bool v)
| Set the "noCursorTimeout" field.
find_options & | operator= (find_options &&other) noexcept
| Move assignment.
find_options & | operator= (find_options const &other)
| Copy assignment.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > | projection () const
| Return the current "projection" field.
find_options & | projection (bsoncxx::v1::document::value v)
| Set the "projection" field.
bsoncxx::v1::stdx::optional< v1::read_concern > | read_concern () const
| Return the current "readConcern" field.
find_options & | read_concern (v1::read_concern v)
| Set the "readConcern" field.
bsoncxx::v1::stdx::optional< v1::read_preference > | read_preference () const
| Return the current "readPreference" field.
find_options & | read_preference (v1::read_preference v)
| Set the "readPreference" field.
bsoncxx::v1::stdx::optional< bool > | return_key () const
| Return the current "returnKey" field.
find_options & | return_key (bool v)
| Set the "returnKey" field.
bsoncxx::v1::stdx::optional< bool > | show_record_id () const
| Return the current "showRecordId" field.
find_options & | show_record_id (bool v)
| Set the "showRecordId" field.
bsoncxx::v1::stdx::optional< std::int64_t > | skip () const
| Return the current "skip" field.
find_options & | skip (std::int64_t v)
| Set the "skip" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > | sort () const
| Return the current "sort" field.
find_options & | sort (bsoncxx::v1::document::value v)
| 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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

Set the "projection" field.

## read_concern() [1/2]

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

Return the current "readConcern" field.

## read_concern() [2/2]

find_options & mongocxx::v1::find_options::read_concern | ( | v1::read_concern | v | ) |

Set the "readConcern" 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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

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 | v | ) |

Set the "sort" field.

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

- mongocxx/v1/find_options.hpp