MongoDB C++ Driver 4.4.0
Loading...
Searching...
No Matches
search_indexes.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/v1/search_indexes-fwd.hpp> // IWYU pragma: export
18
19//
20
22
25
28
31
34
35#include <string>
36#include <vector>
37
38namespace mongocxx {
39namespace v1 {
40
50 private:
51 class impl;
52 void* _impl;
53
54 public:
55 class model;
56
63
71
79
84
89
94
99 v1::client_session const& session,
100 v1::aggregate_options const& opts = {});
101
107 v1::aggregate_options const& opts = {});
108
114 v1::client_session const& session,
115 bsoncxx::v1::stdx::string_view name,
116 v1::aggregate_options const& opts = {});
117
132
147 v1::client_session const& session,
148 bsoncxx::v1::document::view definition);
149
165 bsoncxx::v1::document::view definition);
166
180 MONGOCXX_ABI_EXPORT_CDECL(std::string)
182 v1::client_session const& session,
183 bsoncxx::v1::stdx::string_view name,
184 bsoncxx::v1::document::view definition);
185
199 MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(model const& index);
200
214 MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(v1::client_session const& session, model const& index);
215
227 MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string>) create_many(std::vector<model> const& indexes);
228
240 MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string>) create_many(
241 v1::client_session const& session,
242 std::vector<model> const& indexes);
243
253 MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(bsoncxx::v1::stdx::string_view name);
254
264 MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(v1::client_session const& session, bsoncxx::v1::stdx::string_view name);
265
276 bsoncxx::v1::stdx::string_view name,
277 bsoncxx::v1::document::view definition);
278
290 v1::client_session const& session,
291 bsoncxx::v1::stdx::string_view name,
292 bsoncxx::v1::document::view definition);
293
294 class internal;
295
296 private:
297 /* explicit(false) */ search_indexes(void* impl);
298};
299
312 // This class implements both `SearchIndexModel` and `SearchIndexOptions` ("Index View API"):
313 // - https://specifications.readthedocs.io/en/latest/index-management/index-management/
314
315 private:
316 class impl;
317 void* _impl;
318
319 public:
326
334
341 MONGOCXX_ABI_EXPORT_CDECL(model&) operator=(model&& other) noexcept;
342
347
351 MONGOCXX_ABI_EXPORT_CDECL(model&) operator=(model const& other);
352
360 model(std::string name, bsoncxx::v1::document::value definition);
361
369 model(bsoncxx::v1::document::value definition);
370
374 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) name() const;
375
380
384 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) type() const;
385
390
391 class internal;
392};
393
394} // namespace v1
395} // namespace mongocxx
396
397#include <mongocxx/v1/detail/postlude.hpp>
398
Provides mongocxx::v1::aggregate_options.
A non-owning, read-only BSON document.
Definition view.hpp:52
A polyfill for std::string_view.
Definition string_view.hpp:412
Options for an "aggregate" command.
Definition aggregate_options.hpp:62
A MongoDB client session.
Definition client_session.hpp:46
A MongoDB cursor.
Definition cursor.hpp:39
Support for MongoDB indexes.
Definition indexes.hpp:56
A description of a MongoDB Atlas Search index.
Definition search_indexes.hpp:311
model(model &&other) noexcept
Move constructor.
bsoncxx::v1::document::view definition() const
Return the current "definition" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::stdx::string_view > name() const
Return the current "name" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::stdx::string_view > type() const
Return the current "type" field.
~search_indexes()
Destroy this object.
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.
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.
void drop_one(bsoncxx::v1::stdx::string_view name)
Drop the search index with the given name in the associated collection.
std::string create_one(v1::client_session const &session, bsoncxx::v1::document::view definition)
Create a single search index in the associated collection.
search_indexes(search_indexes &&other) noexcept
Move constructor.
v1::cursor list(v1::client_session const &session, v1::aggregate_options const &opts={})
Return information for all search indexes in the associated collection.
std::vector< std::string > create_many(std::vector< model > const &indexes)
Create multiple search indexes in the associated collection.
std::string create_one(bsoncxx::v1::document::view definition)
Create a single search index in the associated collection.
v1::cursor list(v1::aggregate_options const &opts={})
Return information for all search indexes in the associated collection.
std::string create_one(bsoncxx::v1::stdx::string_view name, bsoncxx::v1::document::view definition)
Create a single search index in the associated collection.
Provides macros to control the set of symbols exported in the ABI.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v1 macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities whose ABI stability is guaranteed for documented symbols.
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v1::search_indexes.
Declares mongocxx::v1::client_session.
Declares mongocxx::v1::cursor.
Declares bsoncxx::v1::document::value.
Declares bsoncxx::v1::document::view.
Provides std::optional-related polyfills for library API usage.
Provides std::string_view-related polyfills for library API usage.