#include <mongocxx/v1/indexes.hpp>
Support for MongoDB indexes.
Classes | |
| class | create_many_options |
| Options for mongocxx::v1::indexes::create_many. More... | |
| class | create_one_options |
| Options for mongocxx::v1::indexes::create_one. More... | |
| class | drop_all_options |
| Options for mongocxx::v1::indexes::drop_all. More... | |
| class | drop_one_options |
| Options for mongocxx::v1::indexes::drop_one. More... | |
| class | list_options |
| Options for mongocxx::v1::indexes::list. More... | |
| class | model |
| A description of a MongoDB index. More... | |
| class | options |
| Options for mongocxx::v1::indexes::model. More... | |
Public Types | |
| enum class | errc |
| Errors codes which may be returned by mongocxx::v1::indexes. More... | |
Public Member Functions | |
| indexes (indexes &&other) noexcept | |
| Move constructor. | |
| indexes (indexes const &other) | |
| Copy constructor. | |
| ~indexes () | |
| Destroy this object. | |
| bsoncxx::v1::document::value | create_many (std::vector< model > const &indexes, create_many_options const &create_opts={}) |
| Create multiple indexes in the associated collection. | |
| bsoncxx::v1::document::value | create_many (v1::client_session const &session, std::vector< model > const &indexes, create_many_options const &create_opts={}) |
| Create multiple indexes in the associated collection. | |
| bsoncxx::v1::stdx::optional< std::string > | create_one (bsoncxx::v1::document::value keys, bsoncxx::v1::document::value index_opts={}, create_one_options const &create_opts={}) |
| Equivalent to this->create_one(model(keys, index_opts), create_opts). | |
| bsoncxx::v1::stdx::optional< std::string > | create_one (model const &index, create_one_options const &create_opts={}) |
| Create a single index in the associated collection. | |
| bsoncxx::v1::stdx::optional< std::string > | create_one (v1::client_session const &session, bsoncxx::v1::document::value keys, bsoncxx::v1::document::value index_opts={}, create_one_options const &create_opts={}) |
| Equivalent to this->create_one(session, model(keys, index_opts), create_opts). | |
| bsoncxx::v1::stdx::optional< std::string > | create_one (v1::client_session const &session, model const &index, create_one_options const &create_opts={}) |
| Create a single index in the associated collection. | |
| void | drop_all (drop_all_options const &drop_opts={}) |
| Drop all indexes in the associated collection. | |
| void | drop_all (v1::client_session const &session, drop_all_options const &drop_opts={}) |
| Drop all indexes in the associated collection. | |
| void | drop_one (bsoncxx::v1::document::value keys, bsoncxx::v1::document::value index_opts={}, drop_one_options const &drop_opts={}) |
| Equivalent to this->drop_one(mongocxx::v1::indexes::model(keys, index_opts), drop_opts). | |
| void | drop_one (bsoncxx::v1::stdx::string_view index, drop_one_options const &drop_opts={}) |
| Drop a single index in the associated collection. | |
| void | drop_one (client_session const &session, bsoncxx::v1::document::value keys, bsoncxx::v1::document::value index_opts={}, drop_one_options const &drop_opts={}) |
| Equivalent to this->drop_one(session, mongocxx::v1::indexes::model(keys, index_opts), drop_opts). | |
| void | drop_one (model const &index, drop_one_options const &drop_opts={}) |
| Drop a single index in the associated collection. | |
| void | drop_one (v1::client_session const &session, bsoncxx::v1::stdx::string_view index, drop_one_options const &drop_opts={}) |
| Drop a single index in the associated collection. | |
| void | drop_one (v1::client_session const &session, model const &index, drop_one_options const &drop_opts={}) |
| Drop a single index in the associated collection. | |
| v1::cursor | list (list_options const &list_opts={}) |
| Return all indexes in the associated collection. | |
| v1::cursor | list (v1::client_session const &session, list_options const &list_opts={}) |
| Return all indexes in the associated collection. | |
| indexes & | operator= (indexes &&other) noexcept |
| Move assignment. | |
| indexes & | operator= (indexes const &other) |
| Copy assignment. | |
Static Public Member Functions | |
| static std::error_category const & | error_category () |
| The error category for mongocxx::v1::instance::errc. | |
Friends | |
| std::error_code | make_error_code (errc v) |
| Support implicit conversion to std::error_code. | |
|
strong |
Errors codes which may be returned by mongocxx::v1::indexes.
| Enumerator | |
|---|---|
| zero | Zero. |
| expired_after_i32 | The "expiredAfterSeconds" field must be representable as an std::int32_t. |
| invalid_name | "*" is not a permitted index name. |
| mongocxx::v1::indexes::~indexes | ( | ) |
Destroy this object.
|
noexcept |
Move constructor.
| mongocxx::v1::indexes::indexes | ( | indexes const & | other | ) |
Copy constructor.
| bsoncxx::v1::document::value mongocxx::v1::indexes::create_many | ( | std::vector< model > const & | indexes, |
| create_many_options const & | create_opts = {} ) |
Create multiple indexes in the associated collection.
| indexes | The definitions of the new indexes. The options must be applicable to the "createIndexes" command. |
| create_opts | "createIndexes" command options. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| bsoncxx::v1::document::value mongocxx::v1::indexes::create_many | ( | v1::client_session const & | session, |
| std::vector< model > const & | indexes, | ||
| create_many_options const & | create_opts = {} ) |
Create multiple indexes in the associated collection.
| session | The session with which this operation is associated. |
| indexes | The definitions of the new indexes. The options must be applicable to the "createIndexes" command. |
| create_opts | "createIndexes" command options. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
inline |
Equivalent to this->create_one(model(keys, index_opts), create_opts).
| bsoncxx::v1::stdx::optional< std::string > mongocxx::v1::indexes::create_one | ( | model const & | index, |
| create_one_options const & | create_opts = {} ) |
Create a single index in the associated collection.
Equivalent to this->create_many(...) with a single index model.
| index | The definition of the new index. The options must be applicable to the "createIndexes" command. |
| create_opts | "createIndexes" command options. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
inline |
Equivalent to this->create_one(session, model(keys, index_opts), create_opts).
| bsoncxx::v1::stdx::optional< std::string > mongocxx::v1::indexes::create_one | ( | v1::client_session const & | session, |
| model const & | index, | ||
| create_one_options const & | create_opts = {} ) |
Create a single index in the associated collection.
Equivalent to this->create_many(...) with a single index model.
| session | The session with which this operation is associated. |
| index | The definition of the new index. The options must be applicable to the "createIndexes" command. |
| create_opts | "createIndexes" command options. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::indexes::drop_all | ( | drop_all_options const & | drop_opts = {} | ) |
Drop all indexes in the associated collection.
| drop_opts | "dropIndexes" command options. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::indexes::drop_all | ( | v1::client_session const & | session, |
| drop_all_options const & | drop_opts = {} ) |
Drop all indexes in the associated collection.
| session | The session with which this operation is associated. |
| drop_opts | "dropIndexes" command options. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
inline |
Equivalent to this->drop_one(mongocxx::v1::indexes::model(keys, index_opts), drop_opts).
| void mongocxx::v1::indexes::drop_one | ( | bsoncxx::v1::stdx::string_view | index, |
| drop_one_options const & | drop_opts = {} ) |
Drop a single index in the associated collection.
| index | The name of index to drop. |
| drop_opts | "dropIndexes" command options. |
| mongocxx::v1::exception | with mongocxx::v1::indexes::errc::invalid_name if name is equal to "*". |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
inline |
Equivalent to this->drop_one(session, mongocxx::v1::indexes::model(keys, index_opts), drop_opts).
| void mongocxx::v1::indexes::drop_one | ( | model const & | index, |
| drop_one_options const & | drop_opts = {} ) |
Drop a single index in the associated collection.
| index | The description of the index to drop. |
| drop_opts | "dropIndexes" command options. |
| mongocxx::v1::exception | with mongocxx::v1::indexes::errc::invalid_name if name is equal to "*". |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::indexes::drop_one | ( | v1::client_session const & | session, |
| bsoncxx::v1::stdx::string_view | index, | ||
| drop_one_options const & | drop_opts = {} ) |
Drop a single index in the associated collection.
| session | The session with which this operation is associated. |
| index | The name of index to drop. |
| drop_opts | "dropIndexes" command options. |
| mongocxx::v1::exception | with mongocxx::v1::indexes::errc::invalid_name if name is equal to "*". |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::indexes::drop_one | ( | v1::client_session const & | session, |
| model const & | index, | ||
| drop_one_options const & | drop_opts = {} ) |
Drop a single index in the associated collection.
| session | The session with which this operation is associated. |
| index | The description of the index to drop. |
| drop_opts | "dropIndexes" command options. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
static |
The error category for mongocxx::v1::instance::errc.
| v1::cursor mongocxx::v1::indexes::list | ( | list_options const & | list_opts = {} | ) |
Return all indexes in the associated collection.
| list_opts | "listIndexes" command options. |
| v1::cursor mongocxx::v1::indexes::list | ( | v1::client_session const & | session, |
| list_options const & | list_opts = {} ) |
Return all indexes in the associated collection.
| session | The session with which this operation is associated. |
| list_opts | "listIndexes" command options. |
Move assignment.
|
friend |
Support implicit conversion to std::error_code.