MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
search_index_view.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <mongocxx/search_index_view-fwd.hpp> // IWYU pragma: export
18
19//
20
21#include <mongocxx/v1/search_indexes.hpp> // IWYU pragma: export
22
23#include <string>
24#include <utility>
25#include <vector>
26
28#include <mongocxx/collection-fwd.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
29
31#include <bsoncxx/stdx/optional.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
33
34#include <mongocxx/cursor.hpp>
37
39
40namespace mongocxx {
41namespace v_noabi {
42
48class search_index_view {
49 private:
50 v1::search_indexes _indexes;
51
52 public:
53 search_index_view(search_index_view&& other) noexcept = default;
54 search_index_view& operator=(search_index_view&& other) noexcept = default;
55
56 MONGOCXX_ABI_EXPORT_CDECL() search_index_view(search_index_view const& other);
57 MONGOCXX_ABI_EXPORT_CDECL(search_index_view&) operator=(search_index_view const& other);
58
59 ~search_index_view() = default;
60
64 /* explicit(false) */ search_index_view(v1::search_indexes search_index_view)
65 : _indexes{std::move(search_index_view)} {}
66
75 explicit operator v1::search_indexes() && {
76 return std::move(_indexes);
77 }
78
82 explicit operator v1::search_indexes() const& {
83 return _indexes;
84 }
85
95 list(v_noabi::options::aggregate const& options = {});
96
108 list(v_noabi::client_session const& session, v_noabi::options::aggregate const& options = {});
109
121 list(bsoncxx::v_noabi::string::view_or_value name, v_noabi::options::aggregate const& options = {});
122
137 v_noabi::client_session const& session,
138 bsoncxx::v_noabi::string::view_or_value name,
139 v_noabi::options::aggregate const& options = {});
140
149 MONGOCXX_ABI_EXPORT_CDECL(std::string)
150 create_one(bsoncxx::v_noabi::document::view_or_value definition);
151
162 MONGOCXX_ABI_EXPORT_CDECL(std::string)
163 create_one(v_noabi::client_session const& session, bsoncxx::v_noabi::document::view_or_value definition);
164
175 MONGOCXX_ABI_EXPORT_CDECL(std::string)
176 create_one(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition);
177
190 MONGOCXX_ABI_EXPORT_CDECL(std::string)
192 v_noabi::client_session const& session,
193 bsoncxx::v_noabi::string::view_or_value name,
194 bsoncxx::v_noabi::document::view_or_value definition);
195
205
216 MONGOCXX_ABI_EXPORT_CDECL(std::string)
218
227 MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string>)
228 create_many(std::vector<v_noabi::search_index_model> const& models);
229
240 MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string>)
241 create_many(v_noabi::client_session const& session, std::vector<v_noabi::search_index_model> const& models);
242
249 MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(bsoncxx::v_noabi::string::view_or_value name);
250
260 drop_one(v_noabi::client_session const& session, bsoncxx::v_noabi::string::view_or_value name);
261
271 update_one(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition);
272
285 v_noabi::client_session const& session,
286 bsoncxx::v_noabi::string::view_or_value name,
287 bsoncxx::v_noabi::document::view_or_value definition);
288};
289
290} // namespace v_noabi
291} // namespace mongocxx
292
293namespace mongocxx {
294namespace v_noabi {
295
300 return {std::move(v)};
301}
302
309
310} // namespace v_noabi
311} // namespace mongocxx
312
314
Provides mongocxx::v_noabi::options::aggregate.
Support for MongoDB Atlas Search indexes.
Definition search_indexes.hpp:51
Supports MongoDB client session operations.
Definition client_session.hpp:58
A cursor over the documents returned by a query to a MongoDB server.
Definition cursor.hpp:50
Used by mongocxx::v_noabi::search_index_view.
Definition search_index_model.hpp:41
A MongoDB Atlas Search Index.
Definition search_index_view.hpp:48
void drop_one(bsoncxx::v_noabi::string::view_or_value name)
Drops a single search index from the collection by the index name.
search_index_view(v1::search_indexes search_index_view)
Construct with the mongocxx::v1 equivalent.
Definition search_index_view.hpp:64
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.
v_noabi::cursor list(v_noabi::options::aggregate const &options={})
Returns a cursor over all the search indexes.
std::vector< std::string > create_many(std::vector< v_noabi::search_index_model > const &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.
Provides bsoncxx::v_noabi::document::view_or_value.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing bulk write operations.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
The top-level namespace within which all mongocxx library entities are declared.
Provides mongocxx::v_noabi::search_index_model.
Declares mongocxx::v_noabi::search_index_view.
Provides mongocxx::v1::search_indexes.
Provides bsoncxx::v_noabi::string::view_or_value.
Provides std::optional-related polyfills for library API usage.
Declares mongocxx::v_noabi::client_session.
Declares mongocxx::v_noabi::collection.
Provides mongocxx::v_noabi::cursor.