MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
create_collection.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
19
20#include <mongocxx/stdx.hpp>
22
24
25namespace mongocxx {
26namespace v_noabi {
27namespace options {
28
36 public:
53
64
79 collation(bsoncxx::v_noabi::document::view_or_value collation);
80
90 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::document::view_or_value>&)
91 collation() const;
92
108
116 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<std::int64_t>&) max() const;
117
132
142 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bool>&) no_padding() const;
143
160
167 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<std::int64_t>&) size() const;
168
182 storage_engine(bsoncxx::v_noabi::document::view_or_value storage_engine_opts);
183
190 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::document::view_or_value>&)
192
208
218 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<mongocxx::v_noabi::validation_criteria>&)
220
231 to_document() const;
232
233 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::document::value) to_document_deprecated() const;
234
240 MONGOCXX_DEPRECATED inline operator bsoncxx::v_noabi::document::value() const {
241 return to_document_deprecated();
242 }
243
244 private:
245 stdx::optional<bool> _capped;
247 stdx::optional<std::int64_t> _max_documents;
249 stdx::optional<bool> _no_padding;
252};
253
261
262} // namespace options
263} // namespace v_noabi
264} // namespace mongocxx
265
266namespace mongocxx {
267namespace options {
268
269using ::mongocxx::v_noabi::options::create_collection;
270using ::mongocxx::v_noabi::options::create_collection_deprecated;
271
272} // namespace options
273} // namespace mongocxx
274
276
284
285#if defined(MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
286
287namespace mongocxx {
288namespace options {
289
292
295
296} // namespace options
297} // namespace mongocxx
298
299#endif // defined(MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
A polyfill for std::optional<T>.
Definition optional.hpp:874
mongocxx::v_noabi::options::create_collection_deprecated
Definition create_collection.hpp:294
mongocxx::v_noabi::options::create_collection
Definition create_collection.hpp:291
Class representing the optional arguments to a MongoDB createCollection command.
Definition create_collection.hpp:35
MONGOCXX_DEPRECATED operator bsoncxx::v_noabi::document::value() const
Definition create_collection.hpp:240
create_collection_deprecated & capped(bool capped)
To create a capped collection, specify true.
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & storage_engine() const
Gets the current storage engine configuration for this collection.
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & collation() const
Gets the default collation for this collection.
const stdx::optional< bool > & no_padding() const
Gets the current value of the "no padding" option for the collection.
MONGOCXX_DEPRECATED bsoncxx::v_noabi::document::value to_document() const
Return a bson document representing the options set on this object.
const stdx::optional< std::int64_t > & size() const
Gets the current size setting, for a capped collection.
const stdx::optional< std::int64_t > & max() const
Gets the current setting for the maximum number of documents allowed in the capped collection.
const stdx::optional< bool > & capped() const
Gets the current capped setting.
Class representing criteria for document validation, to be applied to a collection.
Definition validation_criteria.hpp:35
Provides bsoncxx::v_noabi::document::view_or_value.
#define MONGOCXX_DEPRECATED
Declares the associated entity as deprecated.
Definition fwd.hpp:258
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
The mongocxx macro guard postlude header.
The mongocxx macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
MONGOCXX_DEPRECATED typedef create_collection_deprecated create_collection
Equivalent to create_collection_deprecated.
Definition create_collection.hpp:260
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.
Redeclares bsoncxx::v_noabi::stdx in mongocxx::v_noabi::stdx for internal use.
Provides mongocxx::v_noabi::validation_criteria.