MongoDB C++ Driver 4.2.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
52 private:
53 class impl;
54 void* _impl;
55
56 public:
57 class model;
58
65
73
81
86
91
96
101 v1::client_session const& session,
102 v1::aggregate_options const& opts = {});
103
109 v1::aggregate_options const& opts = {});
110
116 v1::client_session const& session,
117 bsoncxx::v1::stdx::string_view name,
118 v1::aggregate_options const& opts = {});
119
134
149 v1::client_session const& session,
150 bsoncxx::v1::document::view definition);
151
167 bsoncxx::v1::document::view definition);
168
182 MONGOCXX_ABI_EXPORT_CDECL(std::string)
184 v1::client_session const& session,
185 bsoncxx::v1::stdx::string_view name,
186 bsoncxx::v1::document::view definition);
187
201 MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(model const& index);
202
216 MONGOCXX_ABI_EXPORT_CDECL(std::string) create_one(v1::client_session const& session, model const& index);
217
229 MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string>) create_many(std::vector<model> const& indexes);
230
242 MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string>) create_many(
243 v1::client_session const& session,
244 std::vector<model> const& indexes);
245
255 MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(bsoncxx::v1::stdx::string_view name);
256
266 MONGOCXX_ABI_EXPORT_CDECL(void) drop_one(v1::client_session const& session, bsoncxx::v1::stdx::string_view name);
267
278 bsoncxx::v1::stdx::string_view name,
279 bsoncxx::v1::document::view definition);
280
292 v1::client_session const& session,
293 bsoncxx::v1::stdx::string_view name,
294 bsoncxx::v1::document::view definition);
295
296 class internal;
297
298 private:
299 /* explicit(false) */ search_indexes(void* impl);
300};
301
316 // This class implements both `SearchIndexModel` and `SearchIndexOptions` ("Index View API"):
317 // - https://specifications.readthedocs.io/en/latest/index-management/index-management/
318
319 private:
320 class impl;
321 void* _impl;
322
323 public:
330
338
345 MONGOCXX_ABI_EXPORT_CDECL(model&) operator=(model&& other) noexcept;
346
351
355 MONGOCXX_ABI_EXPORT_CDECL(model&) operator=(model const& other);
356
364 model(std::string name, bsoncxx::v1::document::value definition);
365
373 model(bsoncxx::v1::document::value definition);
374
378 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) name() const;
379
384
388 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) type() const;
389
394
395 class internal;
396};
397
398} // namespace v1
399} // namespace mongocxx
400
401#include <mongocxx/v1/detail/postlude.hpp>
402
Provides mongocxx::v1::aggregate_options.
A non-owning, read-only BSON document.
Definition view.hpp:54
A polyfill for std::string_view.
Definition string_view.hpp:412
Options for an "aggregate" command.
Definition aggregate_options.hpp:64
A MongoDB client session.
Definition client_session.hpp:48
A MongoDB cursor.
Definition cursor.hpp:41
Support for MongoDB indexes.
Definition indexes.hpp:58
A description of a MongoDB Atlas Search index.
Definition search_indexes.hpp:315
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.