MongoDB C++ Driver current
Loading...
Searching...
No Matches
search_index_view.hpp
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include <bsoncxx/document/view_or_value.hpp>
7#include <bsoncxx/stdx/optional.hpp>
8#include <mongocxx/cursor.hpp>
9#include <mongocxx/options/aggregate.hpp>
10#include <mongocxx/search_index_model.hpp>
11
12#include <mongocxx/config/prelude.hpp>
13
14namespace mongocxx {
15inline namespace v_noabi {
19class MONGOCXX_API search_index_view {
20 public:
22 search_index_view& operator=(search_index_view&&) noexcept;
23
25 search_index_view& operator=(const search_index_view&);
26
28
40
51 cursor list(const client_session& session,
52 const options::aggregate& options = options::aggregate());
53
64 cursor list(bsoncxx::string::view_or_value name,
65 const options::aggregate& options = options::aggregate());
66
79 cursor list(const client_session& session,
80 bsoncxx::string::view_or_value name,
81 const options::aggregate& options = options::aggregate());
82
86
97 std::string create_one(bsoncxx::document::view_or_value definition);
98
109 std::string create_one(const client_session& session,
110 bsoncxx::document::view_or_value definition);
111
122 std::string create_one(bsoncxx::string::view_or_value name,
123 bsoncxx::document::view_or_value definition);
124
137 std::string create_one(const client_session& session,
138 bsoncxx::string::view_or_value name,
139 bsoncxx::document::view_or_value definition);
140
149 std::string create_one(const search_index_model& model);
150
161 std::string create_one(const client_session& session, const search_index_model& model);
162
166
177 std::vector<std::string> create_many(const std::vector<search_index_model>& models);
178
189 std::vector<std::string> create_many(const client_session& session,
190 const std::vector<search_index_model>& models);
191
195
204 void drop_one(bsoncxx::string::view_or_value name);
205
214 void drop_one(const client_session& session, bsoncxx::string::view_or_value name);
215
219
230 void update_one(bsoncxx::string::view_or_value name,
231 bsoncxx::document::view_or_value definition);
232
243 void update_one(const client_session& session,
244 bsoncxx::string::view_or_value name,
245 bsoncxx::document::view_or_value definition);
246
250
251 private:
252 friend class collection;
253 class MONGOCXX_PRIVATE impl;
254
255 MONGOCXX_PRIVATE search_index_view(void* coll, void* client);
256
257 MONGOCXX_PRIVATE std::vector<std::string> _create_many_helper(
258 bsoncxx::array::view created_indexes);
259
260 MONGOCXX_PRIVATE const impl& _get_impl() const;
261
262 MONGOCXX_PRIVATE impl& _get_impl();
263
264 private:
265 std::unique_ptr<impl> _impl;
266};
267
268} // namespace v_noabi
269} // namespace mongocxx
270
271#include <mongocxx/config/postlude.hpp>
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition client_session.hpp:40
Class representing a client connection to MongoDB.
Definition client.hpp:54
Class representing server side document groupings within a MongoDB database.
Definition collection.hpp:85
Class representing a pointer to the result set of a query on a MongoDB server.
Definition cursor.hpp:36
Class representing the optional arguments to a MongoDB aggregation operation.
Definition aggregate.hpp:39
Class representing a search index on a MongoDB server.
Definition search_index_model.hpp:17
Class representing a MongoDB search index view.
Definition search_index_view.hpp:19
std::string create_one(bsoncxx::document::view_or_value definition)
This is a convenience method for creating a single search index with a default name.
cursor list(const options::aggregate &options=options::aggregate())
Returns a cursor over all the search indexes.
void update_one(bsoncxx::string::view_or_value name, bsoncxx::document::view_or_value definition)
Updates a single search index from the collection by the search index name.
std::vector< std::string > create_many(const client_session &session, const std::vector< search_index_model > &models)
Creates multiple search indexes in the collection.
std::string create_one(const client_session &session, const search_index_model &model)
This is a convenience method for creating a single search index.
void drop_one(const client_session &session, bsoncxx::string::view_or_value name)
Drops a single search index from the collection by the index name.
cursor list(bsoncxx::string::view_or_value name, const options::aggregate &options=options::aggregate())
Returns a cursor over all the search indexes.
cursor list(const client_session &session, bsoncxx::string::view_or_value name, const options::aggregate &options=options::aggregate())
Returns a cursor over all the search indexes.
std::string create_one(const search_index_model &model)
This is a convenience method for creating a single search index.
cursor list(const client_session &session, const options::aggregate &options=options::aggregate())
Returns a cursor over all the search indexes.
std::string create_one(const client_session &session, bsoncxx::document::view_or_value definition)
This is a convenience method for creating a single search index with a default name.
std::vector< std::string > create_many(const std::vector< search_index_model > &models)
Creates multiple search indexes in the collection.
void drop_one(bsoncxx::string::view_or_value name)
Drops a single search index from the collection by the index name.
std::string create_one(const client_session &session, bsoncxx::string::view_or_value name, bsoncxx::document::view_or_value definition)
This is a convenience method for creating a single search index.
std::string create_one(bsoncxx::string::view_or_value name, bsoncxx::document::view_or_value definition)
This is a convenience method for creating a single search index.
void update_one(const client_session &session, bsoncxx::string::view_or_value name, bsoncxx::document::view_or_value definition)
Updates a single search index from the collection by the search index name.
The top-level namespace for mongocxx library entities.
Definition bulk_write.hpp:24