MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
mongocxx::v_noabi::options::create_collection_deprecated Class Reference

#include <mongocxx/v_noabi/mongocxx/options/create_collection.hpp>

Description

Class representing the optional arguments to a MongoDB createCollection command.

Deprecated
Use mongocxx::v_noabi::database::create_collection overloads with a BSON document option parameter instead.

Public Member Functions

const stdx::optional< bool > & capped () const
 Gets the current capped setting.
 
create_collection_deprecatedcapped (bool capped)
 To create a capped collection, specify true.
 
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & collation () const
 Gets the default collation for this collection.
 
create_collection_deprecatedcollation (bsoncxx::v_noabi::document::view_or_value collation)
 Sets the default collation for this collection.
 
const stdx::optional< std::int64_t > & max () const
 Gets the current setting for the maximum number of documents allowed in the capped collection.
 
create_collection_deprecatedmax (std::int64_t max_documents)
 The maximum number of documents allowed in the capped collection.
 
const stdx::optional< bool > & no_padding () const
 Gets the current value of the "no padding" option for the collection.
 
create_collection_deprecatedno_padding (bool no_padding)
 When true, disables the power of 2 sizes allocation for the collection.
 
MONGOCXX_DEPRECATED operator bsoncxx::v_noabi::document::value () const
 
const stdx::optional< std::int64_t > & size () const
 Gets the current size setting, for a capped collection.
 
create_collection_deprecatedsize (std::int64_t max_size)
 A maximum size, in bytes, for a capped collection.
 
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & storage_engine () const
 Gets the current storage engine configuration for this collection.
 
create_collection_deprecatedstorage_engine (bsoncxx::v_noabi::document::view_or_value storage_engine_opts)
 Specify configuration to the storage on a per-collection basis.
 
MONGOCXX_DEPRECATED bsoncxx::v_noabi::document::value to_document () const
 Return a bson document representing the options set on this object.
 
const stdx::optional< mongocxx::v_noabi::validation_criteria > & validation_criteria () const
 Gets the current validation criteria for this collection.
 
create_collection_deprecatedvalidation_criteria (mongocxx::v_noabi::validation_criteria validation)
 Specify validation criteria for this collection.
 

Member Function Documentation

◆ capped() [1/2]

const stdx::optional< bool > & mongocxx::v_noabi::options::create_collection_deprecated::capped ( ) const

Gets the current capped setting.

Returns
Whether or not this collection will be capped.
See also

◆ capped() [2/2]

create_collection_deprecated & mongocxx::v_noabi::options::create_collection_deprecated::capped ( bool capped)

To create a capped collection, specify true.

Note
If you specify true, you must also set a maximum size using the size() method.
Parameters
cappedWhether or not this collection will be capped.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also

◆ collation() [1/2]

const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & mongocxx::v_noabi::options::create_collection_deprecated::collation ( ) const

Gets the default collation for this collection.

Returns
The default collation for the collection.
See also

◆ collation() [2/2]

create_collection_deprecated & mongocxx::v_noabi::options::create_collection_deprecated::collation ( bsoncxx::v_noabi::document::view_or_value collation)

Sets the default collation for this collection.

Parameters
collationThe default collation for the collection.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also

◆ max() [1/2]

const stdx::optional< std::int64_t > & mongocxx::v_noabi::options::create_collection_deprecated::max ( ) const

Gets the current setting for the maximum number of documents allowed in the capped collection.

Returns
Maximum number of documents allowed in the collection (if capped).

◆ max() [2/2]

create_collection_deprecated & mongocxx::v_noabi::options::create_collection_deprecated::max ( std::int64_t max_documents)

The maximum number of documents allowed in the capped collection.

Note
The size limit takes precedence over this limit. If a capped collection reaches the size limit before it reaches the maximum number of documents, MongoDB removes old documents.
Parameters
max_documentsMaximum number of documents allowed in the collection (if capped).
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ no_padding() [1/2]

const stdx::optional< bool > & mongocxx::v_noabi::options::create_collection_deprecated::no_padding ( ) const

Gets the current value of the "no padding" option for the collection.

See also
Returns
When true, power of 2 sizing is disabled for this collection.

◆ no_padding() [2/2]

create_collection_deprecated & mongocxx::v_noabi::options::create_collection_deprecated::no_padding ( bool no_padding)

When true, disables the power of 2 sizes allocation for the collection.

See also
Parameters
no_paddingWhen true, disables power of 2 sizing for this collection.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ operator bsoncxx::v_noabi::document::value()

MONGOCXX_DEPRECATED mongocxx::v_noabi::options::create_collection_deprecated::operator bsoncxx::v_noabi::document::value ( ) const
inline
Deprecated
This method is deprecated. To determine which options are set on this object, use the provided accessors instead.

◆ size() [1/2]

const stdx::optional< std::int64_t > & mongocxx::v_noabi::options::create_collection_deprecated::size ( ) const

Gets the current size setting, for a capped collection.

Returns
Maximum size, in bytes, of this collection (if capped).

◆ size() [2/2]

create_collection_deprecated & mongocxx::v_noabi::options::create_collection_deprecated::size ( std::int64_t max_size)

A maximum size, in bytes, for a capped collection.

Note
Once a capped collection reaches its maximum size, MongoDB removes older documents to make space for new documents.
Size is required for capped collections and ignored for other collections.
Parameters
max_sizeMaximum size, in bytes, of this collection (if capped).
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ storage_engine() [1/2]

const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & mongocxx::v_noabi::options::create_collection_deprecated::storage_engine ( ) const

Gets the current storage engine configuration for this collection.

Returns
Configuration options specific to the storage engine.

◆ storage_engine() [2/2]

create_collection_deprecated & mongocxx::v_noabi::options::create_collection_deprecated::storage_engine ( bsoncxx::v_noabi::document::view_or_value storage_engine_opts)

Specify configuration to the storage on a per-collection basis.

Note
This option is currently only available with the WiredTiger storage engine.
Parameters
storage_engine_optsConfiguration options specific to the storage engine.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ to_document()

MONGOCXX_DEPRECATED bsoncxx::v_noabi::document::value mongocxx::v_noabi::options::create_collection_deprecated::to_document ( ) const

Return a bson document representing the options set on this object.

Deprecated
This method is deprecated. To determine which options are set on this object, use the provided accessors instead.
Returns
Options, as a document.

◆ validation_criteria() [1/2]

const stdx::optional< mongocxx::v_noabi::validation_criteria > & mongocxx::v_noabi::options::create_collection_deprecated::validation_criteria ( ) const

Gets the current validation criteria for this collection.

Returns
Validation criteria for this collection.
See also

◆ validation_criteria() [2/2]

create_collection_deprecated & mongocxx::v_noabi::options::create_collection_deprecated::validation_criteria ( mongocxx::v_noabi::validation_criteria validation)

Specify validation criteria for this collection.

Parameters
validationValidation criteria for this collection.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also

The documentation for this class was generated from the following file: