40#include <system_error>
938 create_one_options
const& create_opts = {}) {
939 return this->
create_one(model{std::move(keys), std::move(index_opts)}, create_opts);
949 create_one_options
const& create_opts = {}) {
950 return this->
create_one(session,
model{std::move(keys), std::move(index_opts)}, create_opts);
1000 std::vector<model>
const&
indexes,
1028 drop_one_options
const& drop_opts = {}) {
1029 return this->
drop_one(model{std::move(keys), std::move(index_opts)}, drop_opts);
1039 drop_one_options
const& drop_opts = {}) {
1040 return this->
drop_one(session,
model{std::move(keys), std::move(index_opts)}, drop_opts);
1159struct is_error_code_enum<
mongocxx::v1::indexes::errc> : true_type {};
A BSON document.
Definition value.hpp:46
A polyfill for std::optional<T>.
Definition optional.hpp:799
A polyfill for std::string_view.
Definition string_view.hpp:412
A MongoDB client session.
Definition client_session.hpp:48
A MongoDB cursor.
Definition cursor.hpp:41
Options for mongocxx::v1::indexes::create_many.
Definition indexes.hpp:536
create_many_options(create_many_options &&other) noexcept
Move constructor.
create_many_options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
~create_many_options()
Destroy this object.
create_many_options & commit_quorum(bsoncxx::v1::document::value v)
Set the "commitQuorum" field.
create_many_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
create_many_options & max_time(std::chrono::milliseconds v)
Set the "maxTimeMS" field.
Options for mongocxx::v1::indexes::create_one.
Definition indexes.hpp:435
create_one_options(create_one_options &&other) noexcept
Move constructor.
create_one_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
~create_one_options()
Destroy this object.
create_one_options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
create_one_options & commit_quorum(bsoncxx::v1::document::value v)
Set the "commitQuorum" field.
create_one_options & max_time(std::chrono::milliseconds v)
Set the "maxTimeMS" field.
Options for mongocxx::v1::indexes::drop_all.
Definition indexes.hpp:724
drop_all_options & max_time(std::chrono::milliseconds v)
Set the "maxTimeMS" field.
drop_all_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
drop_all_options(drop_all_options &&other) noexcept
Move constructor.
~drop_all_options()
Destroy this object.
drop_all_options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
Options for mongocxx::v1::indexes::drop_one.
Definition indexes.hpp:635
drop_one_options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
drop_one_options(drop_one_options &&other) noexcept
Move constructor.
drop_one_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
drop_one_options & max_time(std::chrono::milliseconds v)
Set the "maxTimeMS" field.
~drop_one_options()
Destroy this object.
Options for mongocxx::v1::indexes::list.
Definition indexes.hpp:812
~list_options()
Destroy this object.
list_options & batch_size(std::int32_t v)
Set the "batchSize" field.
list_options(list_options &&other) noexcept
Move constructor.
list_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
A description of a MongoDB index.
Definition indexes.hpp:355
bsoncxx::v1::document::view options() const
Return the current "options" field.
model(model &&other) noexcept
Move constructor.
bsoncxx::v1::document::view keys() const
Return the current "keys" field.
~model()
Destroy this object.
options & collation(bsoncxx::v1::document::value v)
Set the "collation" field.
options & twod_location_min(double v)
Set the "min" field.
options & default_language(std::string v)
Set the "default_language" field.
options & expire_after(std::chrono::seconds v)
Set the "expireAfterSeconds" field.
options & twod_location_max(double v)
Set the "max" field.
options & wildcard_projection(bsoncxx::v1::document::value v)
Set the "wildcardProjection" field.
options & background(bool v)
Set the "background" field.
options & partial_filter_expression(bsoncxx::v1::document::value v)
Set the "partialFilterExpression" field.
options(options &&other) noexcept
Move constructor.
~options()
Destroy this object.
options & language_override(std::string v)
Set the "language_override" field.
operator bsoncxx::v1::document::value() const
Return these index management options as a document.
options & storage_engine(bsoncxx::v1::document::value v)
Set the "storageEngine" field.
options & version(std::int32_t v)
Set the "version" field.
options & twod_sphere_version(std::uint8_t v)
Set the "2dsphereIndexVersion" field.
options & text_index_version(std::int32_t v)
Set the "textIndexVersion" field.
options & sparse(bool v)
Set the "sparse" field.
options & weights(bsoncxx::v1::document::value v)
Set the "weights" field.
options & unique(bool v)
Set the "unique" field.
options & hidden(bool v)
Set the "hidden" field.
options & name(std::string v)
Set the "name" field.
options & twod_bits_precision(std::uint8_t v)
Set the "bits" field.
v1::cursor list(v1::client_session const &session, list_options const &list_opts={})
Return 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).
Definition indexes.hpp:1025
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),...
Definition indexes.hpp:1035
static std::error_category const & error_category()
The error category for mongocxx::v1::instance::errc.
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(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).
Definition indexes.hpp:935
errc
Errors codes which may be returned by mongocxx::v1::indexes.
Definition indexes.hpp:1125
@ invalid_name
"*" is not a permitted index name.
Definition indexes.hpp:1128
@ expired_after_i32
The "expiredAfterSeconds" field must be representable as an std::int32_t.
Definition indexes.hpp:1127
@ zero
Zero.
Definition indexes.hpp:1126
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).
Definition indexes.hpp:945
v1::cursor list(list_options const &list_opts={})
Return all indexes in the associated collection.
bsoncxx::v1::document::value create_many(std::vector< model > const &indexes, create_many_options const &create_opts={})
Create multiple indexes in the associated collection.
friend std::error_code make_error_code(errc v)
Support implicit conversion to std::error_code.
Definition indexes.hpp:1143
void drop_all(v1::client_session const &session, drop_all_options const &drop_opts={})
Drop all indexes in the associated collection.
void drop_one(model const &index, drop_one_options const &drop_opts={})
Drop a single index in the associated collection.
void drop_all(drop_all_options const &drop_opts={})
Drop all indexes in the associated collection.
indexes(indexes &&other) noexcept
Move constructor.
void drop_one(bsoncxx::v1::stdx::string_view index, drop_one_options const &drop_opts={})
Drop a single index in the associated collection.
Declares mongocxx::v1::indexes.
Provides macros to control the set of symbols exported in the ABI.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v1 macro guard postlude header.
The mongocxx v1 macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing bulk write operations.
Declares entities whose ABI stability is guaranteed for documented symbols.
@ mongocxx
From the mongocxx library.
Definition exception.hpp:42
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v1::client_session.
Declares mongocxx::v1::cursor.
Provides bsoncxx::v1::document::value.
Provides bsoncxx::v1::document::view.
Provides std::optional-related polyfills for library API usage.
Provides std::string_view-related polyfills for library API usage.
Declares bsoncxx::v1::types::value.
Declares non-owning, read-only entities representing a BSON type value.
Declares mongocxx::v1::write_concern.