Loading...
Searching...
No Matches
search_index_view.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/search_index_view-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/search_indexes.hpp> // IWYU pragma: export
#include <string>
#include <utility>
#include <vector>
#include <mongocxx/client_session-fwd.hpp>
#include <mongocxx/collection-fwd.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
#include <bsoncxx/document/view_or_value.hpp>
#include <bsoncxx/stdx/optional.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
#include <bsoncxx/string/view_or_value.hpp>
#include <mongocxx/cursor.hpp>
#include <mongocxx/options/aggregate.hpp>
#include <mongocxx/search_index_model.hpp>
#include <mongocxx/config/prelude.hpp>
namespace mongocxx {
namespace v_noabi {
class search_index_view {
private:
v1::search_indexes _indexes;
public:
search_index_view(search_index_view&& other) noexcept = default;
search_index_view& operator=(search_index_view&& other) noexcept = default;
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE() search_index_view(search_index_view const& other);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(search_index_view&) operator=(search_index_view const& other);
~search_index_view() = default;
/* explicit(false) */ search_index_view(v1::search_indexes search_index_view)
: _indexes{std::move(search_index_view)} {}
explicit operator v1::search_indexes() && {
return std::move(_indexes);
}
explicit operator v1::search_indexes() const& {
return _indexes;
}
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(v_noabi::cursor)
list(v_noabi::options::aggregate const& options = {});
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(v_noabi::cursor)
list(v_noabi::client_session const& session, v_noabi::options::aggregate const& options = {});
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(v_noabi::cursor)
list(bsoncxx::v_noabi::string::view_or_value name, v_noabi::options::aggregate const& options = {});
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(v_noabi::cursor)
list(
v_noabi::client_session const& session,
bsoncxx::v_noabi::string::view_or_value name,
v_noabi::options::aggregate const& options = {});
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::string)
create_one(bsoncxx::v_noabi::document::view_or_value definition);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::string)
create_one(v_noabi::client_session const& session, bsoncxx::v_noabi::document::view_or_value definition);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::string)
create_one(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::string)
create_one(
v_noabi::client_session const& session,
bsoncxx::v_noabi::string::view_or_value name,
bsoncxx::v_noabi::document::view_or_value definition);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::string) create_one(v_noabi::search_index_model const& model);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::string)
create_one(v_noabi::client_session const& session, v_noabi::search_index_model const& model);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::vector<std::string>)
create_many(std::vector<v_noabi::search_index_model> const& models);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::vector<std::string>)
create_many(v_noabi::client_session const& session, std::vector<v_noabi::search_index_model> const& models);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(void) drop_one(bsoncxx::v_noabi::string::view_or_value name);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(void)
drop_one(v_noabi::client_session const& session, bsoncxx::v_noabi::string::view_or_value name);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(void)
update_one(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(void)
update_one(
v_noabi::client_session const& session,
bsoncxx::v_noabi::string::view_or_value name,
bsoncxx::v_noabi::document::view_or_value definition);
};
} // namespace v_noabi
} // namespace mongocxx
namespace mongocxx {
namespace v_noabi {
inline v_noabi::search_index_view from_v1(v1::search_indexes v) {
return {std::move(v)};
}
inline v1::search_indexes to_v1(v_noabi::search_index_view v) {
return v1::search_indexes{std::move(v)};
}
} // namespace v_noabi
} // namespace mongocxx
#include <mongocxx/config/postlude.hpp>
aggregate.hpp
Provides mongocxx::v_noabi::options::aggregate.
mongocxx::v1::search_indexes
Support for MongoDB Atlas Search indexes.
Definition search_indexes.hpp:49
mongocxx::v_noabi::client_session
Supports MongoDB client session operations.
Definition client_session.hpp:58
mongocxx::v_noabi::cursor
A cursor over the documents returned by a query to a MongoDB server.
Definition cursor.hpp:50
mongocxx::v_noabi::search_index_model
Used by mongocxx::v_noabi::search_index_view.
Definition search_index_model.hpp:41
mongocxx::v_noabi::search_index_view
A MongoDB Atlas Search Index.
Definition search_index_view.hpp:48
mongocxx::v_noabi::search_index_view::drop_one
void drop_one(bsoncxx::v_noabi::string::view_or_value name)
Drops a single search index from the collection by the index name.
mongocxx::v_noabi::search_index_view::search_index_view
search_index_view(v1::search_indexes search_index_view)
Construct with the mongocxx::v1 equivalent.
Definition search_index_view.hpp:64
mongocxx::v_noabi::search_index_view::create_one
std::string create_one(bsoncxx::v_noabi::document::view_or_value definition)
This is a convenience method for creating a single search index with a default name.
mongocxx::v_noabi::search_index_view::list
v_noabi::cursor list(v_noabi::options::aggregate const &options={})
Returns a cursor over all the search indexes.
mongocxx::v_noabi::search_index_view::create_many
std::vector< std::string > create_many(std::vector< v_noabi::search_index_model > const &models)
Creates multiple search indexes in the collection.
mongocxx::v_noabi::search_index_view::update_one
void update_one(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition)
Updates a single search index from the collection by the search index name.
view_or_value.hpp
Provides bsoncxx::v_noabi::document::view_or_value.
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE
#define MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(...)
Equivalent to MONGOCXX_ABI_EXPORT_UNSTABLE with MONGOCXX_ABI_CDECL.
Definition config.hpp:28
postlude.hpp
The mongocxx v_noabi macro guard postlude header.
prelude.hpp
The mongocxx v_noabi macro guard prelude header.
bsoncxx
The top-level namespace within which all bsoncxx library entities are declared.
mongocxx::v_noabi::model
Declares entities representing bulk write operations.
mongocxx::v_noabi::options
Declares entities representing options to use with various commands.
mongocxx::v_noabi
Declares entities whose ABI stability is NOT guaranteed.
mongocxx::v_noabi::to_v1
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
mongocxx::v_noabi::from_v1
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
search_index_model.hpp
Provides mongocxx::v_noabi::search_index_model.
search_index_view-fwd.hpp
Declares mongocxx::v_noabi::search_index_view.
search_indexes.hpp
Provides mongocxx::v1::search_indexes.
view_or_value.hpp
Provides bsoncxx::v_noabi::string::view_or_value.
optional.hpp
Provides std::optional-related polyfills for library API usage.
client_session-fwd.hpp
Declares mongocxx::v_noabi::client_session.
collection-fwd.hpp
Declares mongocxx::v_noabi::collection.
cursor.hpp
Provides mongocxx::v_noabi::cursor.