MongoDB C++ Driver current
Loading...
Searching...
No Matches
index_model.hpp
1// Copyright 2017 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 <bsoncxx/document/value.hpp>
18#include <bsoncxx/document/view_or_value.hpp>
19#include <mongocxx/options/index.hpp>
20
21#include <mongocxx/config/prelude.hpp>
22
23namespace mongocxx {
24inline namespace v_noabi {
28class MONGOCXX_API index_model {
29 public:
33 index_model(const bsoncxx::document::view_or_value& keys,
34 const bsoncxx::document::view_or_value& options = {});
35
36 index_model() = delete;
37
42
46 index_model& operator=(index_model&&) noexcept;
47
52
53 index_model& operator=(const index_model&) = delete;
54
59
63 bsoncxx::document::view keys() const;
64
68 bsoncxx::document::view options() const;
69
70 private:
71 bsoncxx::document::value _keys;
72 bsoncxx::document::value _options;
73};
74
75} // namespace v_noabi
76} // namespace mongocxx
77
78#include <mongocxx/config/postlude.hpp>
Class representing an index on a MongoDB server.
Definition index_model.hpp:28
index_model(index_model &&) noexcept
Move constructs an index_model.
index_model(const bsoncxx::document::view_or_value &keys, const bsoncxx::document::view_or_value &options={})
Initializes a new index_model over a mongocxx::collection.
The top-level namespace for bsoncxx library entities.
Definition element.hpp:24
The top-level namespace for mongocxx library entities.
Definition bulk_write.hpp:24