Loading...
Searching...
No Matches
search_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/search_indexes-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/detail/prelude.hpp>
#include <bsoncxx/v1/document/value-fwd.hpp>
#include <bsoncxx/v1/document/view-fwd.hpp>
#include <mongocxx/v1/client_session-fwd.hpp>
#include <mongocxx/v1/cursor-fwd.hpp>
#include <bsoncxx/v1/stdx/optional.hpp>
#include <bsoncxx/v1/stdx/string_view.hpp>
#include <mongocxx/v1/aggregate_options.hpp>
#include <mongocxx/v1/config/export.hpp>
#include <string>
#include <vector>
namespace mongocxx {
namespace v1 {
class search_indexes {
private:
class impl;
void* _impl;
public:
class model;
MONGOCXX_ABI_EXPORT_CDECL() ~search_indexes();
MONGOCXX_ABI_EXPORT_CDECL() search_indexes(search_indexes&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(search_indexes&) operator=(search_indexes&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() search_indexes(search_indexes const& other);
MONGOCXX_ABI_EXPORT_CDECL(search_indexes&) operator=(search_indexes const& other);
MONGOCXX_ABI_EXPORT_CDECL(v1::cursor) list(v1::aggregate_options const& opts = {});
MONGOCXX_ABI_EXPORT_CDECL(v1::cursor) list(
v1::client_session const& session,
v1::aggregate_options const& opts = {});
MONGOCXX_ABI_EXPORT_CDECL(v1::cursor) list(
bsoncxx::v1::stdx::string_view name,
v1::aggregate_options const& opts = {});
MONGOCXX_ABI_EXPORT_CDECL(v1::cursor)
list(
v1::client_session const& session,
bsoncxx::v1::stdx::string_view name,
v1::aggregate_options const& opts = {});
MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(bsoncxx::v1::document::view definition);
MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(
v1::client_session const& session,
bsoncxx::v1::document::view definition);
MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(
bsoncxx::v1::stdx::string_view name,
bsoncxx::v1::document::view definition);
MONGOCXX_ABI_EXPORT_CDECL(std::string)
create_one(
v1::client_session const& session,
bsoncxx::v1::stdx::string_view name,
bsoncxx::v1::document::view definition);
MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(model const& index);
MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(v1::client_session const& session, model const& index);
MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string>) create_many(std::vector<model> const& indexes);
MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string>) create_many(
v1::client_session const& session,
std::vector<model> const& indexes);
MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(bsoncxx::v1::stdx::string_view name);
MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(v1::client_session const& session, bsoncxx::v1::stdx::string_view name);
MONGOCXX_ABI_EXPORT_CDECL(void) update_one(
bsoncxx::v1::stdx::string_view name,
bsoncxx::v1::document::view definition);
MONGOCXX_ABI_EXPORT_CDECL(void)
update_one(
v1::client_session const& session,
bsoncxx::v1::stdx::string_view name,
bsoncxx::v1::document::view definition);
class internal;
private:
/* explicit(false) */ search_indexes(void* impl);
};
class search_indexes::model {
// This class implements both `SearchIndexModel` and `SearchIndexOptions` ("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);
MONGOCXX_ABI_EXPORT_CDECL()
model(std::string name, bsoncxx::v1::document::value definition);
MONGOCXX_ABI_EXPORT_CDECL()
model(bsoncxx::v1::document::value definition);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) name() const;
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::document::view) definition() const;
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) type() const;
MONGOCXX_ABI_EXPORT_CDECL(model&) type(std::string type);
class internal;
};
} // namespace v1
} // namespace mongocxx
#include <mongocxx/v1/detail/postlude.hpp>
aggregate_options.hpp
Provides mongocxx::v1::aggregate_options.
bsoncxx::v1::document::view
A non-owning, read-only BSON document.
Definition view.hpp:52
bsoncxx::v1::stdx::string_view
A polyfill for std::string_view.
Definition string_view.hpp:412
mongocxx::v1::aggregate_options
Options for an "aggregate" command.
Definition aggregate_options.hpp:62
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
Support for MongoDB indexes.
Definition indexes.hpp:56
mongocxx::v1::search_indexes::model
A description of a MongoDB Atlas Search index.
Definition search_indexes.hpp:311
mongocxx::v1::search_indexes::model::model
model(model &&other) noexcept
Move constructor.
mongocxx::v1::search_indexes::model::definition
bsoncxx::v1::document::view definition() const
Return the current "definition" field.
mongocxx::v1::search_indexes::model::name
bsoncxx::v1::stdx::optional< bsoncxx::v1::stdx::string_view > name() const
Return the current "name" field.
mongocxx::v1::search_indexes::model::~model
~model()
Destroy this object.
mongocxx::v1::search_indexes::model::type
bsoncxx::v1::stdx::optional< bsoncxx::v1::stdx::string_view > type() const
Return the current "type" field.
mongocxx::v1::search_indexes::~search_indexes
~search_indexes()
Destroy this object.
mongocxx::v1::search_indexes::list
v1::cursor list(bsoncxx::v1::stdx::string_view name, v1::aggregate_options const &opts={})
Return information for the search index with the given name in the associated collection.
mongocxx::v1::search_indexes::update_one
void update_one(bsoncxx::v1::stdx::string_view name, bsoncxx::v1::document::view definition)
Update the definition of the search index with the given name in the associated collection.
mongocxx::v1::search_indexes::drop_one
void drop_one(bsoncxx::v1::stdx::string_view name)
Drop the search index with the given name in the associated collection.
mongocxx::v1::search_indexes::create_one
std::string create_one(v1::client_session const &session, bsoncxx::v1::document::view definition)
Create a single search index in the associated collection.
mongocxx::v1::search_indexes::search_indexes
search_indexes(search_indexes &&other) noexcept
Move constructor.
mongocxx::v1::search_indexes::list
v1::cursor list(v1::client_session const &session, v1::aggregate_options const &opts={})
Return information for all search indexes in the associated collection.
mongocxx::v1::search_indexes::create_many
std::vector< std::string > create_many(std::vector< model > const &indexes)
Create multiple search indexes in the associated collection.
mongocxx::v1::search_indexes::create_one
std::string create_one(bsoncxx::v1::document::view definition)
Create a single search index in the associated collection.
mongocxx::v1::search_indexes::list
v1::cursor list(v1::aggregate_options const &opts={})
Return information for all search indexes in the associated collection.
mongocxx::v1::search_indexes::create_one
std::string create_one(bsoncxx::v1::stdx::string_view name, bsoncxx::v1::document::view definition)
Create a single search index in the associated collection.
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
prelude.hpp
The mongocxx v1 macro guard prelude header.
bsoncxx
The top-level namespace within which all bsoncxx library entities are declared.
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
search_indexes-fwd.hpp
Declares mongocxx::v1::search_indexes.
client_session-fwd.hpp
Declares mongocxx::v1::client_session.
cursor-fwd.hpp
Declares mongocxx::v1::cursor.
value-fwd.hpp
Declares bsoncxx::v1::document::value.
view-fwd.hpp
Declares 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.