MongoDB C++ Driver  mongocxx-3.10.2
search_index_view.hpp
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include <mongocxx/collection-fwd.hpp>
7 #include <mongocxx/search_index_view-fwd.hpp>
8 
9 #include <bsoncxx/document/view_or_value.hpp>
10 #include <bsoncxx/stdx/optional.hpp>
11 #include <mongocxx/cursor.hpp>
12 #include <mongocxx/options/aggregate.hpp>
13 #include <mongocxx/search_index_model.hpp>
14 
15 #include <mongocxx/config/prelude.hpp>
16 
17 namespace mongocxx {
18 namespace v_noabi {
19 
24  public:
26  search_index_view& operator=(search_index_view&&) noexcept;
27 
29  search_index_view& operator=(const search_index_view&);
30 
32 
44 
55  cursor list(const client_session& session,
56  const options::aggregate& options = options::aggregate());
57 
69  const options::aggregate& options = options::aggregate());
70 
83  cursor list(const client_session& session,
85  const options::aggregate& options = options::aggregate());
86 
90 
102 
113  std::string create_one(const client_session& session,
115 
128 
141  std::string create_one(const client_session& session,
144 
153  std::string create_one(const search_index_model& model);
154 
165  std::string create_one(const client_session& session, const search_index_model& model);
166 
170 
181  std::vector<std::string> create_many(const std::vector<search_index_model>& models);
182 
193  std::vector<std::string> create_many(const client_session& session,
194  const std::vector<search_index_model>& models);
195 
199 
209 
219 
223 
236 
247  void update_one(const client_session& session,
250 
254 
255  private:
256  friend ::mongocxx::v_noabi::collection;
257 
258  class MONGOCXX_PRIVATE impl;
259 
260  MONGOCXX_PRIVATE search_index_view(void* coll, void* client);
261 
262  MONGOCXX_PRIVATE std::vector<std::string> _create_many_helper(
263  bsoncxx::v_noabi::array::view created_indexes);
264 
265  MONGOCXX_PRIVATE const impl& _get_impl() const;
266 
267  MONGOCXX_PRIVATE impl& _get_impl();
268 
269  private:
270  std::unique_ptr<impl> _impl;
271 };
272 
273 } // namespace v_noabi
274 } // namespace mongocxx
275 
276 #include <mongocxx/config/postlude.hpp>
A read-only, non-owning view of a BSON document.
Definition: view.hpp:36
Class representing a view-or-value variant type for strings.
Definition: view_or_value.hpp:38
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition: client_session.hpp:47
Class representing a client connection to MongoDB.
Definition: client.hpp:61
Class representing a pointer to the result set of a query on a MongoDB server.
Definition: cursor.hpp:42
Class representing the optional arguments to a MongoDB aggregation operation.
Definition: aggregate.hpp:43
Class representing a search index on a MongoDB server.
Definition: search_index_model.hpp:20
Class representing a MongoDB search index view.
Definition: search_index_view.hpp:23
void drop_one(bsoncxx::v_noabi::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::v_noabi::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.
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(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition)
This is a convenience method for creating a single search index.
cursor list(bsoncxx::v_noabi::string::view_or_value name, const options::aggregate &options=options::aggregate())
Returns a cursor over all the search indexes.
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.
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::v_noabi::string::view_or_value name)
Drops a single search index from the collection by the index name.
void update_one(const client_session &session, 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.
cursor list(const client_session &session, bsoncxx::v_noabi::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.
std::string create_one(const client_session &session, bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition)
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::vector< std::string > create_many(const std::vector< search_index_model > &models)
Creates multiple search indexes in the collection.
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.
The top-level namespace for mongocxx library entities.
Definition: bulk_write-fwd.hpp:19