MongoDB C++ Driver current
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_PRIVATE_WARNINGS_PUSH();
46 BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4251));
47 BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4275));
48
55 public:
56 virtual ~base_storage_options();
57
59 base_storage_options& operator=(base_storage_options&&) = default;
61 base_storage_options& operator=(base_storage_options const&) = default;
62
63 base_storage_options() = default;
64
65 private:
66 friend ::mongocxx::v_noabi::options::index;
67
68 virtual int type() const = 0;
69 };
70
109
110 BSONCXX_PRIVATE_WARNINGS_POP();
111
113
129
135 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&) background() const;
136
152
158 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&) unique() const;
159
175
181 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&) hidden() const;
182
194
200 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
201 name() const;
202
217
227 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> const&)
228 collation() const;
229
245
251 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&) sparse() const;
252
268 std::unique_ptr<base_storage_options> storage_options);
269
281 std::unique_ptr<wiredtiger_storage_options> storage_options);
282
301 storage_engine(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> storage_engine);
302
306 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> const&)
308
323 MONGOCXX_ABI_EXPORT_CDECL(index&) expire_after(std::chrono::seconds seconds);
324
330 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::chrono::seconds> const&)
332
344
350 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::int32_t> const&)
351 version() const;
352
365
371 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> const&)
372 weights() const;
373
387
393 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
395
409
415 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
417
430
436 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> const&)
438
450
456 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::uint8_t> const&)
458
470
476 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::uint8_t> const&)
478
490
496 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<double> const&)
498
510
516 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<double> const&)
518
538 MONGOCXX_ABI_EXPORT_CDECL(index&) haystack_bucket_size_deprecated(double haystack_bucket_size);
539
548 MONGOCXX_DEPRECATED MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<double> const&)
550 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<double> const&)
551 haystack_bucket_size_deprecated() const;
552
561 MONGOCXX_ABI_EXPORT_CDECL() operator bsoncxx::v_noabi::document::view_or_value();
562
563 private:
564 friend ::mongocxx::v_noabi::collection;
565
566 bsoncxx::v_noabi::stdx::optional<bool> _background;
567 bsoncxx::v_noabi::stdx::optional<bool> _unique;
568 bsoncxx::v_noabi::stdx::optional<bool> _hidden;
569 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _name;
570 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> _collation;
571 bsoncxx::v_noabi::stdx::optional<bool> _sparse;
572 std::unique_ptr<base_storage_options> _storage_options;
573 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> _storage_engine;
574 bsoncxx::v_noabi::stdx::optional<std::chrono::seconds> _expire_after;
575 bsoncxx::v_noabi::stdx::optional<std::int32_t> _version;
576 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> _weights;
577 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _default_language;
578 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _language_override;
579 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view> _partial_filter_expression;
580 bsoncxx::v_noabi::stdx::optional<std::uint8_t> _twod_sphere_version;
581 bsoncxx::v_noabi::stdx::optional<std::uint8_t> _twod_bits_precision;
582 bsoncxx::v_noabi::stdx::optional<double> _twod_location_min;
583 bsoncxx::v_noabi::stdx::optional<double> _twod_location_max;
584 bsoncxx::v_noabi::stdx::optional<double> _haystack_bucket_size;
585
586 //
587 // Return the current storage_options setting.
588 //
589 std::unique_ptr<base_storage_options> const& storage_options() const;
590};
591
592} // namespace options
593} // namespace v_noabi
594} // namespace mongocxx
595
596#include <bsoncxx/config/postlude.hpp>
597
599
The bsoncxx v_noabi macro guard prelude header.
A polyfill for std::optional<T>.
Definition optional.hpp:800
A view-or-value variant type for strings.
Definition view_or_value.hpp:41
A MongoDB collection.
Definition collection.hpp:87
Base class representing the optional storage engine options for indexes.
Definition index.hpp:54
The optional WiredTiger storage engine options for indexes.
Definition index.hpp:76
void config_string(bsoncxx::v_noabi::string::view_or_value config_string)
Set the WiredTiger configuration string.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > const & config_string() const
The current config_string setting.
Used by MongoDB index creation operations.
Definition index.hpp:43
bsoncxx::v_noabi::stdx::optional< std::chrono::seconds > const & expire_after() const
The current expire_after setting.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > const & weights() const
The current weights setting.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > const & partial_filter_expression() const
The current partial_filter_expression setting.
bsoncxx::v_noabi::stdx::optional< double > const & twod_location_min() const
The current lower inclusive boundary for the longitude and latitude values.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > const & language_override() const
The current name of the field that contains the override language for text indexes.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > const & name() const
The current name setting.
bsoncxx::v_noabi::stdx::optional< double > const & haystack_bucket_size() const
The current haystack_bucket_size setting.
bsoncxx::v_noabi::stdx::optional< std::int32_t > const & version() const
The current index version.
bsoncxx::v_noabi::stdx::optional< bool > const & sparse() const
The current sparse setting.
bsoncxx::v_noabi::stdx::optional< std::uint8_t > const & twod_sphere_version() const
The current twod_sphere_version setting.
bsoncxx::v_noabi::stdx::optional< bool > const & unique() const
The current unique setting.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > const & storage_engine() const
The current storage engine options.
bsoncxx::v_noabi::stdx::optional< std::uint8_t > const & twod_bits_precision() const
The current precision of the stored geohash value of the location data.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > const & default_language() const
The current default_language setting.
bsoncxx::v_noabi::stdx::optional< double > const & twod_location_max() const
The current upper inclusive boundary for the longitude and latitude values.
bsoncxx::v_noabi::stdx::optional< bool > const & background() const
The current background setting.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > const & collation() const
Retrieves the current collation for this index.
operator bsoncxx::v_noabi::document::view_or_value()
Conversion operator that provides a view of the options in document form.
bsoncxx::v_noabi::stdx::optional< bool > const & hidden() const
The current hidden setting.
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.
Declares mongocxx::v_noabi::options::index.
#define MONGOCXX_DEPRECATED
Declares the associated entity as deprecated.
Definition export.hpp:25
#define MONGOCXX_ABI_NO_EXPORT
Excludes the associated entity from being part of the ABI.
Definition export.hpp:20
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
#define MONGOCXX_ABI_EXPORT
Exports the associated entity as part of the ABI.
Definition export.hpp:15
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi 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.
Provides bsoncxx::v_noabi::string::view_or_value.
Provides std::optional-related polyfills for library API usage.