MongoDB C++ Driver mongocxx-4.0.0
Loading...
Searching...
No Matches
index.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 <chrono>
18#include <memory>
19
22
28
30
32
33namespace mongocxx {
34namespace v_noabi {
35namespace options {
36
43class index {
44 public:
45 BSONCXX_PUSH_WARNINGS();
46 BSONCXX_DISABLE_WARNING(MSVC(4251));
47 BSONCXX_DISABLE_WARNING(MSVC(4275));
48
53 public:
54 virtual ~base_storage_options();
55
57 base_storage_options& operator=(base_storage_options&&) = default;
59 base_storage_options& operator=(const base_storage_options&) = default;
60
61 base_storage_options() = default;
62
63 private:
64 friend ::mongocxx::v_noabi::options::index;
65
66 virtual int type() const = 0;
67 };
68
106
107 BSONCXX_POP_WARNINGS();
108
110
126
132 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<bool>&) background() const;
133
149
155 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<bool>&) unique() const;
156
172
178 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<bool>&) hidden() const;
179
191
198 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
199 name() const;
200
215
226 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view>&)
227 collation() const;
228
244
250 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<bool>&) sparse() const;
251
264 storage_options(std::unique_ptr<base_storage_options> storage_options);
265
274 storage_options(std::unique_ptr<wiredtiger_storage_options> storage_options);
275
290 MONGOCXX_ABI_EXPORT_CDECL(index&) expire_after(std::chrono::seconds seconds);
291
297 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<std::chrono::seconds>&)
299
311
317 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<std::int32_t>&)
318 version() const;
319
332
339 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view>&)
340 weights() const;
341
355
362 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
364
378
385 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
387
400
407 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view>&)
409
421
427 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<std::uint8_t>&)
429
441
447 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<std::uint8_t>&)
449
461
467 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<double>&)
469
481
487 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<double>&)
489
510 MONGOCXX_ABI_EXPORT_CDECL(index&) haystack_bucket_size_deprecated(double haystack_bucket_size);
511
520 MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<double>&)
522 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<double>&)
523 haystack_bucket_size_deprecated() const;
524
533 MONGOCXX_ABI_EXPORT_CDECL() operator bsoncxx::v_noabi::document::view_or_value();
534
535 private:
536 friend ::mongocxx::v_noabi::collection;
537
538 bsoncxx::v_noabi::stdx::optional<bool> _background;
539 bsoncxx::v_noabi::stdx::optional<bool> _unique;
540 bsoncxx::v_noabi::stdx::optional<bool> _hidden;
541 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _name;
542 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> _collation;
543 bsoncxx::v_noabi::stdx::optional<bool> _sparse;
544 std::unique_ptr<base_storage_options> _storage_options;
545 bsoncxx::v_noabi::stdx::optional<std::chrono::seconds> _expire_after;
546 bsoncxx::v_noabi::stdx::optional<std::int32_t> _version;
547 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> _weights;
548 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _default_language;
549 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _language_override;
550 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> _partial_filter_expression;
551 bsoncxx::v_noabi::stdx::optional<std::uint8_t> _twod_sphere_version;
552 bsoncxx::v_noabi::stdx::optional<std::uint8_t> _twod_bits_precision;
553 bsoncxx::v_noabi::stdx::optional<double> _twod_location_min;
554 bsoncxx::v_noabi::stdx::optional<double> _twod_location_max;
555 bsoncxx::v_noabi::stdx::optional<double> _haystack_bucket_size;
556
557 //
558 // Return the current storage_options setting.
559 //
560 const std::unique_ptr<base_storage_options>& storage_options() const;
561};
562
563} // namespace options
564} // namespace v_noabi
565} // namespace mongocxx
566
567#include <bsoncxx/config/postlude.hpp>
568
570
The bsoncxx macro guard prelude header.
A polyfill for std::optional<T>.
Definition optional.hpp:826
Class representing a view-or-value variant type for strings.
Definition view_or_value.hpp:41
Class representing server side document groupings within a MongoDB database.
Definition collection.hpp:87
Base class representing the optional storage engine options for indexes.
Definition index.hpp:52
Class representing the optional WiredTiger storage engine options for indexes.
Definition index.hpp:72
void config_string(bsoncxx::v_noabi::string::view_or_value config_string)
Set the WiredTiger configuration string.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & config_string() const
The current config_string setting.
Class representing the optional arguments to a MongoDB create index operation.
Definition index.hpp:43
const bsoncxx::v_noabi::stdx::optional< std::uint8_t > & twod_bits_precision() const
The current precision of the stored geohash value of the location data.
MONGOCXX_DEPRECATED const bsoncxx::v_noabi::stdx::optional< double > & haystack_bucket_size() const
The current haystack_bucket_size setting.
const bsoncxx::v_noabi::stdx::optional< std::chrono::seconds > & expire_after() const
The current expire_after setting.
const bsoncxx::v_noabi::stdx::optional< bool > & unique() const
The current unique setting.
const bsoncxx::v_noabi::stdx::optional< double > & twod_location_min() const
The current lower inclusive boundary for the longitude and latitude values.
const bsoncxx::v_noabi::stdx::optional< std::uint8_t > & twod_sphere_version() const
The current twod_sphere_version setting.
const bsoncxx::v_noabi::stdx::optional< bool > & sparse() const
The current sparse setting.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & collation() const
Retrieves the current collation for this index.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & default_language() const
The current default_language setting.
const bsoncxx::v_noabi::stdx::optional< bool > & background() const
The current background setting.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & weights() const
The current weights setting.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & name() const
The current name setting.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & partial_filter_expression() const
The current partial_filter_expression setting.
const bsoncxx::v_noabi::stdx::optional< bool > & hidden() const
The current hidden setting.
operator bsoncxx::v_noabi::document::view_or_value()
Conversion operator that provides a view of the options in document form.
const bsoncxx::v_noabi::stdx::optional< double > & twod_location_max() const
The current upper inclusive boundary for the longitude and latitude values.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & language_override() const
The current name of the field that contains the override language for text indexes.
const bsoncxx::v_noabi::stdx::optional< std::int32_t > & version() const
The current index version.
Declares mongocxx::v_noabi::collection.
Provides bsoncxx::v_noabi::document::value.
Provides bsoncxx::v_noabi::document::view.
Provides bsoncxx::v_noabi::document::view_or_value.
#define MONGOCXX_DEPRECATED
Declares the associated entity as deprecated.
Definition fwd.hpp:212
#define MONGOCXX_ABI_NO_EXPORT
Excludes the associated entity from being part of the ABI.
Definition fwd.hpp:188
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:204
#define MONGOCXX_ABI_EXPORT
Exports the associated entity as part of the ABI.
Definition fwd.hpp:180
Declares mongocxx::v_noabi::options::index.
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 bsoncxx::v_noabi::string::view_or_value.