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

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

## Description

Used by MongoDB index view operations.

## Public Member Functions

| index_view ()=default
| Default initialization.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > const | commit_quorum () const
| Gets the current commitQuorum setting.
index_view & | commit_quorum (std::int32_t commit_quorum)
| Sets the commit quorum for this operation.
index_view & | commit_quorum (std::string commit_quorum)
| Sets the commit quorum for this operation.
bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > const & | max_time () const
| The current max_time setting.
index_view & | max_time (std::chrono::milliseconds max_time)
| Sets the maximum amount of time for this operation to run (server-side) in milliseconds.
bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > const & | write_concern () const
| Gets the current write concern.
index_view & | write_concern (v_noabi::write_concern write_concern)
| Sets the write concern for this operation.
| index_view (v1::indexes::create_one_options opts)
| Construct with the mongocxx::v1 equivalent.
| index_view (v1::indexes::create_many_options opts)
| Construct with the mongocxx::v1 equivalent.
| operator v1::indexes::create_many_options () const
| Convert to the mongocxx::v1 equivalent.
| operator v1::indexes::create_one_options () const
| Convert to the mongocxx::v1 equivalent.

## Constructor & Destructor Documentation

## index_view() [1/3]

mongocxx::v_noabi::options::index_view::index_view | ( |  | ) |

default

Default initialization.

## index_view() [2/3]

mongocxx::v_noabi::options::index_view::index_view | ( | v1::indexes::create_one_options | opts | ) |

Construct with the mongocxx::v1 equivalent.

## index_view() [3/3]

mongocxx::v_noabi::options::index_view::index_view | ( | v1::indexes::create_many_options | opts | ) |

Construct with the mongocxx::v1 equivalent.

## Member Function Documentation

## commit_quorum() [1/3]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > const mongocxx::v_noabi::options::index_view::commit_quorum | ( |  | ) | const

inline

Gets the current commitQuorum setting.

This option may only be used with MongoDB version 4.4 or later.

Returns
  The current commitQuorum setting.

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

## commit_quorum() [2/3]

index_view & mongocxx::v_noabi::options::index_view::commit_quorum | ( | std::int32_t | commit_quorum | ) |

Sets the commit quorum for this operation.

This option may only be used with MongoDB version 4.4 or later.

Parameters

  commit_quorum | Integer representing the minimum number of data-bearing voting replica set members (i.e. commit quorum), including the primary, that must report a successful index build before the primary marks the indexes as ready. A value of `0` disables quorum-voting behavior.

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/createIndexes

## commit_quorum() [3/3]

index_view & mongocxx::v_noabi::options::index_view::commit_quorum | ( | std::string | commit_quorum | ) |

Sets the commit quorum for this operation.

This option may only be used with MongoDB version 4.4 or later.

Parameters

  commit_quorum | String representing the minimum number of data-bearing voting replica set members (i.e. commit quorum), including the primary, that must report a successful index build before the primary marks the indexes as ready.

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/createIndexes

## max_time() [1/2]

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

inline

The current max_time setting.

Returns
  The current max allowed running time (in milliseconds).

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

## max_time() [2/2]

index_view & mongocxx::v_noabi::options::index_view::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/findAndModify/

## operator v1::indexes::create_many_options()

mongocxx::v_noabi::options::index_view::operator v1::indexes::create_many_options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## operator v1::indexes::create_one_options()

mongocxx::v_noabi::options::index_view::operator v1::indexes::create_one_options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## write_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > const & mongocxx::v_noabi::options::index_view::write_concern | ( |  | ) | const

inline

Gets the current write concern.

Returns
  The current write concern.

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

## write_concern() [2/2]

index_view & mongocxx::v_noabi::options::index_view::write_concern | ( | v_noabi::write_concern | write_concern | ) |

inline

Sets the write concern for this operation.

Parameters

  write_concern | Object representing the write 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/command/findAndModify/

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

- mongocxx/v_noabi/mongocxx/options/index_view.hpp