MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
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 <string>
18#include <vector>
19
22
25
27#include <mongocxx/cursor.hpp>
30
32
33namespace mongocxx {
34namespace v_noabi {
35
40 public:
42 MONGOCXX_ABI_EXPORT_CDECL(index_view&) operator=(index_view&&) noexcept;
43
45
46 index_view(const index_view&) = delete;
47 MONGOCXX_ABI_EXPORT_CDECL(index_view&) operator=(const index_view&) = delete;
48
53
61
85 create_one(const bsoncxx::v_noabi::document::view_or_value& keys,
86 const bsoncxx::v_noabi::document::view_or_value& index_options = {},
87 const options::index_view& options = options::index_view{});
88
115 const bsoncxx::v_noabi::document::view_or_value& keys,
116 const bsoncxx::v_noabi::document::view_or_value& index_options = {},
117 const options::index_view& options = options::index_view{});
118
140 const options::index_view& options = options::index_view{});
141
165 const index_model& index,
166 const options::index_view& options = options::index_view{});
167
188 create_many(const std::vector<index_model>& indexes,
189 const options::index_view& options = options::index_view{});
190
214 const std::vector<index_model>& indexes,
215 const options::index_view& options = options::index_view{});
216
235 drop_one(stdx::string_view name, const options::index_view& options = options::index_view{});
236
257 drop_one(const client_session& session,
258 stdx::string_view name,
259 const options::index_view& options = options::index_view{});
260
286 drop_one(const bsoncxx::v_noabi::document::view_or_value& keys,
287 const bsoncxx::v_noabi::document::view_or_value& index_options = {},
288 const options::index_view& options = options::index_view{});
289
317 drop_one(const client_session& session,
318 const bsoncxx::v_noabi::document::view_or_value& keys,
319 const bsoncxx::v_noabi::document::view_or_value& index_options = {},
320 const options::index_view& options = options::index_view{});
321
343 drop_one(const index_model& index, const options::index_view& options = options::index_view{});
344
368 drop_one(const client_session& session,
369 const index_model& index,
370 const options::index_view& options = options::index_view{});
371
386 drop_all(const options::index_view& options = options::index_view{});
387
404 drop_all(const client_session& session,
405 const options::index_view& options = options::index_view{});
406
407 private:
408 friend ::mongocxx::v_noabi::collection;
409 class impl;
410
411 index_view(void* coll, void* client);
412
413 impl& _get_impl();
414
415 private:
416 std::unique_ptr<impl> _impl;
417};
418
419} // namespace v_noabi
420} // namespace mongocxx
421
423
A read-only BSON document that owns its underlying buffer. When a document::value goes out of scope,...
Definition value.hpp:38
A polyfill for std::optional<T>.
Definition optional.hpp:874
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition client_session.hpp:48
Class representing a client connection to MongoDB.
Definition client.hpp:62
Class representing a pointer to the result set of a query on a MongoDB server.
Definition cursor.hpp:42
Class representing an index on a MongoDB server.
Definition index_model.hpp:32
Class representing a MongoDB index view.
Definition index_view.hpp:39
stdx::optional< std::string > create_one(const bsoncxx::v_noabi::document::view_or_value &keys, const bsoncxx::v_noabi::document::view_or_value &index_options={}, const options::index_view &options=options::index_view{})
Creates an index. A convenience method that calls create_many.
cursor list()
Returns a cursor over all the indexes.
void drop_one(stdx::string_view name, const options::index_view &options=options::index_view{})
Drops a single index by name.
void drop_all(const options::index_view &options=options::index_view{})
Drops all indexes in the collection.
bsoncxx::v_noabi::document::value create_many(const std::vector< index_model > &indexes, const options::index_view &options=options::index_view{})
Adds a container of indexes to the collection.
cursor list(const client_session &session)
Returns a cursor over all the indexes.
Class representing optional arguments to IndexView operations.
Definition index_view.hpp:35
Provides mongocxx::v_noabi::client_session.
Declares mongocxx::v_noabi::collection.
Provides mongocxx::v_noabi::cursor.
Provides bsoncxx::v_noabi::document::value.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
Provides mongocxx::v_noabi::index_model.
Declares mongocxx::v_noabi::index_view.
The mongocxx macro guard postlude header.
The mongocxx macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
The top-level namespace within which all mongocxx library entities are declared.
The top-level namespace reserved for the C++ standard library.
Provides std::optional-related polyfills for library API usage.
Provides mongocxx::v_noabi::options::index_view.