Loading...
Searching...
No Matches
mongocxx::options::count Class Reference

`#include <mongocxx/v_noabi/mongocxx/options/count.hpp>`

## Description

Used by mongocxx::v_noabi::collection::count_documents.

## Public Member Functions

| count ()=default
| Default initialization.
| count (v1::count_options opts)
| Construct with the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & | collation () const
| Retrieves the current collation for this operation.
count & | collation (bsoncxx::v_noabi::document::view_or_value collation)
| Sets the collation for this operation.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & | comment () const
| Gets the current value of the comment option.
count & | comment (bsoncxx::v_noabi::types::bson_value::view_or_value comment)
| Set the value of the comment option.
bsoncxx::v_noabi::stdx::optional< v_noabi::hint > const & | hint () const
| Gets the current hint.
count & | hint (v_noabi::hint index_hint)
| Sets the index to use for this operation.
bsoncxx::v_noabi::stdx::optional< std::int64_t > const & | limit () const
| Gets the current limit.
count & | limit (std::int64_t limit)
| Sets the maximum number of documents to count.
bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > const & | max_time () const
| The current max_time setting.
count & | max_time (std::chrono::milliseconds max_time)
| Sets the maximum amount of time for this operation to run (server-side) in milliseconds.
| operator v1::count_options () const
| Convert to the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > const & | read_concern () const
| The current read_concern for this operation.
count & | read_concern (v_noabi::read_concern rc)
| Sets the read_concern for this operation.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_preference > const & | read_preference () const
| The current read_preference for this operation.
count & | read_preference (v_noabi::read_preference rp)
| Sets the read_preference for this operation.
bsoncxx::v_noabi::stdx::optional< std::int64_t > const & | skip () const
| Gets the current number of documents to skip.
count & | skip (std::int64_t skip)
| Sets the number of documents to skip before counting documents.

## Constructor & Destructor Documentation

## count() [1/2]

mongocxx::v_noabi::options::count::count | ( |  | ) |

default

Default initialization.

## count() [2/2]

mongocxx::v_noabi::options::count::count | ( | v1::count_options | opts | ) |

Construct with the mongocxx::v1 equivalent.

## Member Function Documentation

## collation() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & mongocxx::v_noabi::options::count::collation | ( |  | ) | const

inline

Retrieves the current collation for this operation.

Returns
  The current collation.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## collation() [2/2]

count & mongocxx::v_noabi::options::count::collation | ( | bsoncxx::v_noabi::document::view_or_value | collation | ) |

inline

Sets the collation for this operation.

Parameters

  collation | The new collation.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## comment() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & mongocxx::v_noabi::options::count::comment | ( |  | ) | const

inline

Gets the current value of the comment option.

Returns
  The current comment option.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## comment() [2/2]

count & mongocxx::v_noabi::options::count::comment | ( | bsoncxx::v_noabi::types::bson_value::view_or_value | comment | ) |

inline

Set the value of the comment option.

Parameters

  comment | The new comment option.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## hint() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::hint > const & mongocxx::v_noabi::options::count::hint | ( |  | ) | const

inline

Gets the current hint.

Returns
  The current hint, if one is set.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## hint() [2/2]

count & mongocxx::v_noabi::options::count::hint | ( | v_noabi::hint | index_hint | ) |

inline

Sets the index to use for this operation.

Parameters

  index_hint | Object representing the index to use.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## limit() [1/2]

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

inline

Gets the current limit.

Returns
  The current limit.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## limit() [2/2]

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

inline

Sets the maximum number of documents to count.

Parameters

  limit | The max number of documents to count.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## max_time() [1/2]

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

inline

The current max_time setting.

Returns
  The current max time (in milliseconds).

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## max_time() [2/2]

count & mongocxx::v_noabi::options::count::max_time | ( | std::chrono::milliseconds | max_time | ) |

inline

Sets the maximum amount of time for this operation to run (server-side) in milliseconds.

Parameters

  max_time | The max amount of time (in milliseconds).

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## operator v1::count_options()

mongocxx::v_noabi::options::count::operator v1::count_options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## read_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > const & mongocxx::v_noabi::options::count::read_concern | ( |  | ) | const

inline

The current read_concern for this operation.

Returns
  The current read_concern.

See also
  - https://www.mongodb.com/docs/manual/reference/read-concern/

## read_concern() [2/2]

count & mongocxx::v_noabi::options::count::read_concern | ( | v_noabi::read_concern | rc | ) |

inline

Sets the read_concern for this operation.

Parameters

  rc | The new read_concern.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/read-concern/

## read_preference() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::read_preference > const & mongocxx::v_noabi::options::count::read_preference | ( |  | ) | const

inline

The current read_preference for this operation.

Returns
  the current read_preference

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## read_preference() [2/2]

count & mongocxx::v_noabi::options::count::read_preference | ( | v_noabi::read_preference | rp | ) |

inline

Sets the read_preference for this operation.

Parameters

  rp | The new read_preference.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## skip() [1/2]

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

inline

Gets the current number of documents to skip.

Returns
  The number of documents to skip.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

## skip() [2/2]

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

inline

Sets the number of documents to skip before counting documents.

Parameters

  skip | The number of documents to skip.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/command/aggregate/

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

- mongocxx/v_noabi/mongocxx/options/count.hpp