Loading...
Searching...
No Matches
indexes.hpp
Go to the documentation of this file.
// Copyright 2009-present MongoDB, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <mongocxx/v1/indexes-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/detail/prelude.hpp>
#include <bsoncxx/v1/types/value-fwd.hpp>
#include <bsoncxx/v1/types/view-fwd.hpp>
#include <mongocxx/v1/client_session-fwd.hpp>
#include <mongocxx/v1/cursor-fwd.hpp>
#include <mongocxx/v1/write_concern-fwd.hpp>
#include <bsoncxx/v1/document/value.hpp>
#include <bsoncxx/v1/document/view.hpp>
#include <bsoncxx/v1/stdx/optional.hpp>
#include <bsoncxx/v1/stdx/string_view.hpp>
#include <mongocxx/v1/config/export.hpp>
#include <chrono>
#include <cstdint>
#include <string>
#include <system_error>
#include <type_traits>
#include <utility>
#include <vector>
namespace mongocxx {
namespace v1 {
class indexes {
// This class implements `IndexView` ("Index View API"):
// - https://specifications.readthedocs.io/en/latest/index-management/index-management/
private:
class impl;
void* _impl;
public:
class options {
// This class implements `IndexOptions` ("Index View API"):
// - https://specifications.readthedocs.io/en/latest/index-management/index-management/
private:
class impl;
void* _impl;
public:
MONGOCXX_ABI_EXPORT_CDECL() ~options();
MONGOCXX_ABI_EXPORT_CDECL() options(options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(options&) operator=(options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() options(options const& other);
MONGOCXX_ABI_EXPORT_CDECL(options&) operator=(options const& other);
MONGOCXX_ABI_EXPORT_CDECL() options();
MONGOCXX_ABI_EXPORT_CDECL(options&) background(bool v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bool>) background() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) collation(bsoncxx::v1::document::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) collation() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) default_language(std::string v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) default_language() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) expire_after(std::chrono::seconds v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::chrono::seconds>) expire_after() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) hidden(bool v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bool>) hidden() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) language_override(std::string v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) language_override()
const;
MONGOCXX_ABI_EXPORT_CDECL(options&) name(std::string v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) name() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) partial_filter_expression(bsoncxx::v1::document::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) partial_filter_expression()
const;
MONGOCXX_ABI_EXPORT_CDECL(options&) sparse(bool v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bool>) sparse() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) storage_engine(bsoncxx::v1::document::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) storage_engine() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) text_index_version(std::int32_t v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::int32_t>) text_index_version() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) twod_bits_precision(std::uint8_t v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::uint8_t>) twod_bits_precision() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) twod_location_max(double v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<double>) twod_location_max() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) twod_location_min(double v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<double>) twod_location_min() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) twod_sphere_version(std::uint8_t v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::uint8_t>) twod_sphere_version() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) unique(bool v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bool>) unique() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) version(std::int32_t v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::int32_t>) version() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) wildcard_projection(bsoncxx::v1::document::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) wildcard_projection() const;
MONGOCXX_ABI_EXPORT_CDECL(options&) weights(bsoncxx::v1::document::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) weights() const;
/* explicit(false) */ MONGOCXX_ABI_EXPORT_CDECL() operator bsoncxx::v1::document::value() const;
class internal;
};
class model {
// This class implements `IndexModel` ("Index View API"):
// - https://specifications.readthedocs.io/en/latest/index-management/index-management/
private:
class impl;
void* _impl;
public:
MONGOCXX_ABI_EXPORT_CDECL() ~model();
MONGOCXX_ABI_EXPORT_CDECL() model(model&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(model&) operator=(model&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() model(model const& other);
MONGOCXX_ABI_EXPORT_CDECL(model&) operator=(model const& other);
model(bsoncxx::v1::document::value keys, options const& opts)
: model{std::move(keys), bsoncxx::v1::document::value{opts}} {}
MONGOCXX_ABI_EXPORT_CDECL() model(bsoncxx::v1::document::value keys, bsoncxx::v1::document::value options);
MONGOCXX_ABI_EXPORT_CDECL() model(bsoncxx::v1::document::value keys);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::document::view) keys() const;
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::document::view) options() const;
};
class create_one_options {
// This class implements `CreateOneIndexOptions` ("Index View API"):
// - https://specifications.readthedocs.io/en/latest/index-management/index-management
private:
class impl;
void* _impl;
public:
MONGOCXX_ABI_EXPORT_CDECL() ~create_one_options();
MONGOCXX_ABI_EXPORT_CDECL() create_one_options(create_one_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(create_one_options&) operator=(create_one_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() create_one_options(create_one_options const& other);
MONGOCXX_ABI_EXPORT_CDECL(create_one_options&) operator=(create_one_options const& other);
MONGOCXX_ABI_EXPORT_CDECL() create_one_options();
MONGOCXX_ABI_EXPORT_CDECL(create_one_options&) comment(bsoncxx::v1::types::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::types::view>) comment() const;
MONGOCXX_ABI_EXPORT_CDECL(create_one_options&) commit_quorum(bsoncxx::v1::document::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) commit_quorum() const;
MONGOCXX_ABI_EXPORT_CDECL(create_one_options&) max_time(std::chrono::milliseconds v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::chrono::milliseconds>) max_time() const;
MONGOCXX_ABI_EXPORT_CDECL(create_one_options&) write_concern(v1::write_concern v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::write_concern>) write_concern() const;
class internal;
};
class create_many_options {
// This class implements `CreateManyIndexesOptions` ("Index View API"):
// - https://specifications.readthedocs.io/en/latest/index-management/index-management
private:
void* _impl; // create_index_options_impl
public:
MONGOCXX_ABI_EXPORT_CDECL() ~create_many_options();
MONGOCXX_ABI_EXPORT_CDECL() create_many_options(create_many_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(create_many_options&) operator=(create_many_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() create_many_options(create_many_options const& other);
MONGOCXX_ABI_EXPORT_CDECL(create_many_options&) operator=(create_many_options const& other);
MONGOCXX_ABI_EXPORT_CDECL() create_many_options();
MONGOCXX_ABI_EXPORT_CDECL(create_many_options&) comment(bsoncxx::v1::types::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::types::view>) comment() const;
MONGOCXX_ABI_EXPORT_CDECL(create_many_options&) commit_quorum(bsoncxx::v1::document::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) commit_quorum() const;
MONGOCXX_ABI_EXPORT_CDECL(create_many_options&) max_time(std::chrono::milliseconds v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::chrono::milliseconds>) max_time() const;
MONGOCXX_ABI_EXPORT_CDECL(create_many_options&) write_concern(v1::write_concern v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::write_concern>) write_concern() const;
class internal;
};
class drop_one_options {
// This class implements `DropOneIndexOptions` ("Index View API"):
// - https://specifications.readthedocs.io/en/latest/index-management/index-management
private:
void* _impl; // drop_index_options_impl
public:
MONGOCXX_ABI_EXPORT_CDECL() ~drop_one_options();
MONGOCXX_ABI_EXPORT_CDECL() drop_one_options(drop_one_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(drop_one_options&) operator=(drop_one_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() drop_one_options(drop_one_options const& other);
MONGOCXX_ABI_EXPORT_CDECL(drop_one_options&) operator=(drop_one_options const& other);
MONGOCXX_ABI_EXPORT_CDECL() drop_one_options();
MONGOCXX_ABI_EXPORT_CDECL(drop_one_options&) comment(bsoncxx::v1::types::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::types::view>) comment() const;
MONGOCXX_ABI_EXPORT_CDECL(drop_one_options&) max_time(std::chrono::milliseconds v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::chrono::milliseconds>) max_time() const;
MONGOCXX_ABI_EXPORT_CDECL(drop_one_options&) write_concern(v1::write_concern v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::write_concern>) write_concern() const;
class internal;
};
class drop_all_options {
// This class implements `DropAllIndexesOptions` ("Index View API"):
// - https://specifications.readthedocs.io/en/latest/index-management/index-management
private:
void* _impl; // drop_index_options_impl
public:
MONGOCXX_ABI_EXPORT_CDECL() ~drop_all_options();
MONGOCXX_ABI_EXPORT_CDECL() drop_all_options(drop_all_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(drop_all_options&) operator=(drop_all_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() drop_all_options(drop_all_options const& other);
MONGOCXX_ABI_EXPORT_CDECL(drop_all_options&) operator=(drop_all_options const& other);
MONGOCXX_ABI_EXPORT_CDECL() drop_all_options();
MONGOCXX_ABI_EXPORT_CDECL(drop_all_options&) comment(bsoncxx::v1::types::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::types::view>) comment() const;
MONGOCXX_ABI_EXPORT_CDECL(drop_all_options&) max_time(std::chrono::milliseconds v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::chrono::milliseconds>) max_time() const;
MONGOCXX_ABI_EXPORT_CDECL(drop_all_options&) write_concern(v1::write_concern v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::write_concern>) write_concern() const;
class internal;
};
class list_options {
// This class implements `ListIndexesOptions` ("Index View API"):
// - https://specifications.readthedocs.io/en/latest/index-management/index-management
private:
class impl;
void* _impl;
public:
MONGOCXX_ABI_EXPORT_CDECL() ~list_options();
MONGOCXX_ABI_EXPORT_CDECL() list_options(list_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(list_options&) operator=(list_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() list_options(list_options const& other);
MONGOCXX_ABI_EXPORT_CDECL(list_options&) operator=(list_options const& other);
MONGOCXX_ABI_EXPORT_CDECL() list_options();
MONGOCXX_ABI_EXPORT_CDECL(list_options&) batch_size(std::int32_t v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::int32_t>) batch_size() const;
MONGOCXX_ABI_EXPORT_CDECL(list_options&) comment(bsoncxx::v1::types::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::types::view>) comment() const;
class internal;
};
MONGOCXX_ABI_EXPORT_CDECL() ~indexes();
MONGOCXX_ABI_EXPORT_CDECL() indexes(indexes&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(indexes&) operator=(indexes&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() indexes(indexes const& other);
MONGOCXX_ABI_EXPORT_CDECL(indexes&) operator=(indexes const& other);
MONGOCXX_ABI_EXPORT_CDECL(v1::cursor) list(list_options const& list_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(v1::cursor) list(v1::client_session const& session, list_options const& list_opts = {});
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 = {}) {
return this->create_one(model{std::move(keys), std::move(index_opts)}, create_opts);
}
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 = {}) {
return this->create_one(session, model{std::move(keys), std::move(index_opts)}, create_opts);
}
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::string>) create_one(
model const& index,
create_one_options const& create_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::string>)
create_one(v1::client_session const& session, model const& index, create_one_options const& create_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::document::value) create_many(
std::vector<model> const& indexes,
create_many_options const& create_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::document::value)
create_many(
v1::client_session const& session,
std::vector<model> const& indexes,
create_many_options const& create_opts = {});
void drop_one(
bsoncxx::v1::document::value keys,
bsoncxx::v1::document::value index_opts = {},
drop_one_options const& drop_opts = {}) {
return this->drop_one(model{std::move(keys), std::move(index_opts)}, drop_opts);
}
void drop_one(
client_session const& session,
bsoncxx::v1::document::value keys,
bsoncxx::v1::document::value index_opts = {},
drop_one_options const& drop_opts = {}) {
return this->drop_one(session, model{std::move(keys), std::move(index_opts)}, drop_opts);
}
MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(
bsoncxx::v1::stdx::string_view index,
drop_one_options const& drop_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(void)
drop_one(
v1::client_session const& session,
bsoncxx::v1::stdx::string_view index,
drop_one_options const& drop_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(model const& index, drop_one_options const& drop_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(void)
drop_one(v1::client_session const& session, model const& index, drop_one_options const& drop_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(void) drop_all(drop_all_options const& drop_opts = {});
MONGOCXX_ABI_EXPORT_CDECL(void) drop_all(v1::client_session const& session, drop_all_options const& drop_opts = {});
enum class errc {
zero,
expired_after_i32,
invalid_name,
};
static MONGOCXX_ABI_EXPORT_CDECL(std::error_category const&) error_category();
friend std::error_code make_error_code(errc v) {
return {static_cast<int>(v), error_category()};
}
class internal;
private:
/* explicit(false) */ indexes(void* impl);
};
} // namespace v1
} // namespace mongocxx
namespace std {
template <>
struct is_error_code_enum<mongocxx::v1::indexes::errc> : true_type {};
} // namespace std
#include <mongocxx/v1/detail/postlude.hpp>
bsoncxx::v1::document::value
A BSON document.
Definition value.hpp:44
bsoncxx::v1::stdx::optional
A polyfill for std::optional<T>.
Definition optional.hpp:799
bsoncxx::v1::stdx::string_view
A polyfill for std::string_view.
Definition string_view.hpp:412
mongocxx::v1::client_session
A MongoDB client session.
Definition client_session.hpp:46
mongocxx::v1::cursor
A MongoDB cursor.
Definition cursor.hpp:39
mongocxx::v1::indexes::create_many_options
Options for mongocxx::v1::indexes::create_many.
Definition indexes.hpp:530
mongocxx::v1::indexes::create_many_options::create_many_options
create_many_options(create_many_options &&other) noexcept
Move constructor.
mongocxx::v1::indexes::create_many_options::write_concern
create_many_options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
mongocxx::v1::indexes::create_many_options::~create_many_options
~create_many_options()
Destroy this object.
mongocxx::v1::indexes::create_many_options::commit_quorum
create_many_options & commit_quorum(bsoncxx::v1::document::value v)
Set the "commitQuorum" field.
mongocxx::v1::indexes::create_many_options::comment
create_many_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
mongocxx::v1::indexes::create_many_options::max_time
create_many_options & max_time(std::chrono::milliseconds v)
Set the "maxTimeMS" field.
mongocxx::v1::indexes::create_one_options
Options for mongocxx::v1::indexes::create_one.
Definition indexes.hpp:429
mongocxx::v1::indexes::create_one_options::create_one_options
create_one_options(create_one_options &&other) noexcept
Move constructor.
mongocxx::v1::indexes::create_one_options::comment
create_one_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
mongocxx::v1::indexes::create_one_options::~create_one_options
~create_one_options()
Destroy this object.
mongocxx::v1::indexes::create_one_options::write_concern
create_one_options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
mongocxx::v1::indexes::create_one_options::commit_quorum
create_one_options & commit_quorum(bsoncxx::v1::document::value v)
Set the "commitQuorum" field.
mongocxx::v1::indexes::create_one_options::max_time
create_one_options & max_time(std::chrono::milliseconds v)
Set the "maxTimeMS" field.
mongocxx::v1::indexes::drop_all_options
Options for mongocxx::v1::indexes::drop_all.
Definition indexes.hpp:718
mongocxx::v1::indexes::drop_all_options::max_time
drop_all_options & max_time(std::chrono::milliseconds v)
Set the "maxTimeMS" field.
mongocxx::v1::indexes::drop_all_options::comment
drop_all_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
mongocxx::v1::indexes::drop_all_options::drop_all_options
drop_all_options(drop_all_options &&other) noexcept
Move constructor.
mongocxx::v1::indexes::drop_all_options::~drop_all_options
~drop_all_options()
Destroy this object.
mongocxx::v1::indexes::drop_all_options::write_concern
drop_all_options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
mongocxx::v1::indexes::drop_one_options
Options for mongocxx::v1::indexes::drop_one.
Definition indexes.hpp:629
mongocxx::v1::indexes::drop_one_options::write_concern
drop_one_options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
mongocxx::v1::indexes::drop_one_options::drop_one_options
drop_one_options(drop_one_options &&other) noexcept
Move constructor.
mongocxx::v1::indexes::drop_one_options::comment
drop_one_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
mongocxx::v1::indexes::drop_one_options::max_time
drop_one_options & max_time(std::chrono::milliseconds v)
Set the "maxTimeMS" field.
mongocxx::v1::indexes::drop_one_options::~drop_one_options
~drop_one_options()
Destroy this object.
mongocxx::v1::indexes::list_options
Options for mongocxx::v1::indexes::list.
Definition indexes.hpp:806
mongocxx::v1::indexes::list_options::~list_options
~list_options()
Destroy this object.
mongocxx::v1::indexes::list_options::batch_size
list_options & batch_size(std::int32_t v)
Set the "batchSize" field.
mongocxx::v1::indexes::list_options::list_options
list_options(list_options &&other) noexcept
Move constructor.
mongocxx::v1::indexes::list_options::comment
list_options & comment(bsoncxx::v1::types::value v)
Set the "comment" field.
mongocxx::v1::indexes::model
A description of a MongoDB index.
Definition indexes.hpp:349
mongocxx::v1::indexes::model::options
bsoncxx::v1::document::view options() const
Return the current "options" field.
mongocxx::v1::indexes::model::model
model(model &&other) noexcept
Move constructor.
mongocxx::v1::indexes::model::keys
bsoncxx::v1::document::view keys() const
Return the current "keys" field.
mongocxx::v1::indexes::model::~model
~model()
Destroy this object.
mongocxx::v1::indexes::options::collation
options & collation(bsoncxx::v1::document::value v)
Set the "collation" field.
mongocxx::v1::indexes::options::twod_location_min
options & twod_location_min(double v)
Set the "min" field.
mongocxx::v1::indexes::options::default_language
options & default_language(std::string v)
Set the "default_language" field.
mongocxx::v1::indexes::options::expire_after
options & expire_after(std::chrono::seconds v)
Set the "expireAfterSeconds" field.
mongocxx::v1::indexes::options::twod_location_max
options & twod_location_max(double v)
Set the "max" field.
mongocxx::v1::indexes::options::wildcard_projection
options & wildcard_projection(bsoncxx::v1::document::value v)
Set the "wildcardProjection" field.
mongocxx::v1::indexes::options::background
options & background(bool v)
Set the "background" field.
mongocxx::v1::indexes::options::partial_filter_expression
options & partial_filter_expression(bsoncxx::v1::document::value v)
Set the "partialFilterExpression" field.
mongocxx::v1::indexes::options::options
options(options &&other) noexcept
Move constructor.
mongocxx::v1::indexes::options::~options
~options()
Destroy this object.
mongocxx::v1::indexes::options::language_override
options & language_override(std::string v)
Set the "language_override" field.
mongocxx::v1::indexes::options::value
operator bsoncxx::v1::document::value() const
Return these index management options as a document.
mongocxx::v1::indexes::options::storage_engine
options & storage_engine(bsoncxx::v1::document::value v)
Set the "storageEngine" field.
mongocxx::v1::indexes::options::version
options & version(std::int32_t v)
Set the "version" field.
mongocxx::v1::indexes::options::twod_sphere_version
options & twod_sphere_version(std::uint8_t v)
Set the "2dsphereIndexVersion" field.
mongocxx::v1::indexes::options::text_index_version
options & text_index_version(std::int32_t v)
Set the "textIndexVersion" field.
mongocxx::v1::indexes::options::sparse
options & sparse(bool v)
Set the "sparse" field.
mongocxx::v1::indexes::options::weights
options & weights(bsoncxx::v1::document::value v)
Set the "weights" field.
mongocxx::v1::indexes::options::unique
options & unique(bool v)
Set the "unique" field.
mongocxx::v1::indexes::options::hidden
options & hidden(bool v)
Set the "hidden" field.
mongocxx::v1::indexes::options::name
options & name(std::string v)
Set the "name" field.
mongocxx::v1::indexes::options::twod_bits_precision
options & twod_bits_precision(std::uint8_t v)
Set the "bits" field.
mongocxx::v1::indexes::list
v1::cursor list(v1::client_session const &session, list_options const &list_opts={})
Return all indexes in the associated collection.
mongocxx::v1::indexes::drop_one
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:1019
mongocxx::v1::indexes::drop_one
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:1029
mongocxx::v1::indexes::error_category
static std::error_category const & error_category()
The error category for mongocxx::v1::instance::errc.
mongocxx::v1::indexes::create_one
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.
mongocxx::v1::indexes::create_one
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:929
mongocxx::v1::indexes::errc
errc
Errors codes which may be returned by mongocxx::v1::indexes.
Definition indexes.hpp:1117
mongocxx::v1::indexes::errc::invalid_name
@ invalid_name
"*" is not a permitted index name.
Definition indexes.hpp:1120
mongocxx::v1::indexes::errc::expired_after_i32
@ expired_after_i32
The "expiredAfterSeconds" field must be representable as an std::int32_t.
Definition indexes.hpp:1119
mongocxx::v1::indexes::errc::zero
@ zero
Zero.
Definition indexes.hpp:1118
mongocxx::v1::indexes::create_one
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:939
mongocxx::v1::indexes::list
v1::cursor list(list_options const &list_opts={})
Return all indexes in the associated collection.
mongocxx::v1::indexes::create_many
bsoncxx::v1::document::value create_many(std::vector< model > const &indexes, create_many_options const &create_opts={})
Create multiple indexes in the associated collection.
mongocxx::v1::indexes::make_error_code
friend std::error_code make_error_code(errc v)
Support implicit conversion to std::error_code.
Definition indexes.hpp:1131
mongocxx::v1::indexes::drop_all
void drop_all(v1::client_session const &session, drop_all_options const &drop_opts={})
Drop all indexes in the associated collection.
mongocxx::v1::indexes::drop_one
void drop_one(model const &index, drop_one_options const &drop_opts={})
Drop a single index in the associated collection.
mongocxx::v1::indexes::drop_all
void drop_all(drop_all_options const &drop_opts={})
Drop all indexes in the associated collection.
mongocxx::v1::indexes::indexes
indexes(indexes &&other) noexcept
Move constructor.
mongocxx::v1::indexes::drop_one
void drop_one(bsoncxx::v1::stdx::string_view index, drop_one_options const &drop_opts={})
Drop a single index in the associated collection.
indexes-fwd.hpp
Declares mongocxx::v1::indexes.
export.hpp
Provides macros to control the set of symbols exported in the ABI.
MONGOCXX_ABI_EXPORT_CDECL
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
postlude.hpp
The mongocxx v1 macro guard postlude header.
prelude.hpp
The mongocxx v1 macro guard prelude header.
bsoncxx
The top-level namespace within which all bsoncxx library entities are declared.
mongocxx::model
Declares entities representing bulk write operations.
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx::v1::source_errc::mongocxx
@ mongocxx
From the mongocxx library.
Definition exception.hpp:40
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
client_session-fwd.hpp
Declares mongocxx::v1::client_session.
cursor-fwd.hpp
Declares mongocxx::v1::cursor.
value.hpp
Provides bsoncxx::v1::document::value.
view.hpp
Provides bsoncxx::v1::document::view.
optional.hpp
Provides std::optional-related polyfills for library API usage.
string_view.hpp
Provides std::string_view-related polyfills for library API usage.
value-fwd.hpp
Declares bsoncxx::v1::types::value.
view-fwd.hpp
Declares non-owning, read-only entities representing a BSON type value.
write_concern-fwd.hpp
Declares mongocxx::v1::write_concern.