MongoDB C++ Driver mongocxx-4.0.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(bsoncxx::v_noabi::stdx::string_view name,
236 const options::index_view& options = options::index_view{});
237
258 drop_one(const client_session& session,
259 bsoncxx::v_noabi::stdx::string_view name,
260 const options::index_view& options = options::index_view{});
261
287 drop_one(const bsoncxx::v_noabi::document::view_or_value& keys,
288 const bsoncxx::v_noabi::document::view_or_value& index_options = {},
289 const options::index_view& options = options::index_view{});
290
318 drop_one(const client_session& session,
319 const bsoncxx::v_noabi::document::view_or_value& keys,
320 const bsoncxx::v_noabi::document::view_or_value& index_options = {},
321 const options::index_view& options = options::index_view{});
322
344 drop_one(const index_model& index, const options::index_view& options = options::index_view{});
345
369 drop_one(const client_session& session,
370 const index_model& index,
371 const options::index_view& options = options::index_view{});
372
387 drop_all(const options::index_view& options = options::index_view{});
388
405 drop_all(const client_session& session,
406 const options::index_view& options = options::index_view{});
407
408 private:
409 friend ::mongocxx::v_noabi::collection;
410 class impl;
411
412 index_view(void* coll, void* client);
413
414 impl& _get_impl();
415
416 private:
417 std::unique_ptr<impl> _impl;
418};
419
420} // namespace v_noabi
421} // namespace mongocxx
422
424
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:826
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:61
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
cursor list()
Returns a cursor over all the indexes.
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.
void drop_one(bsoncxx::v_noabi::stdx::string_view name, const options::index_view &options=options::index_view{})
Drops a single index by name.
bsoncxx::v_noabi::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(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:204
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.