MongoDB C++ Driver  mongocxx-3.0.2
Public Member Functions | List of all members
mongocxx::options::modify_collection Class Reference

Class representing the optional arguments to a MongoDB collMod command. More...

#include <modify_collection.hpp>

Public Member Functions

modify_collectionindex (bsoncxx::document::view_or_value index_spec, std::chrono::seconds seconds)
 The index flag changes the expiration time of a TTL collection. More...
 
modify_collectionno_padding (bool no_padding)
 When true, disables the power of 2 sizes allocation for the collection. More...
 
modify_collectionvalidation_criteria (class validation_criteria validation)
 Specify validation criteria for this collection. More...
 
bsoncxx::document::value to_document () const
 Return a bson document representing a collMod command with the given options set on this object. More...
 

Detailed Description

Class representing the optional arguments to a MongoDB collMod command.

Member Function Documentation

modify_collection& mongocxx::options::modify_collection::index ( bsoncxx::document::view_or_value  index_spec,
std::chrono::seconds  seconds 
)

The index flag changes the expiration time of a TTL collection.

Parameters
index_specthe spec for an existing index in the collection
secondsnumber of seconds to subtract from the current time
See also
https://docs.mongodb.org/manual/tutorial/expire-data/
modify_collection& mongocxx::options::modify_collection::no_padding ( bool  no_padding)

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

See also
: https://docs.mongodb.org/manual/reference/method/db.createCollection/
Parameters
no_paddingWhen true, disables power of 2 sizing for this collection.
bsoncxx::document::value mongocxx::options::modify_collection::to_document ( ) const

Return a bson document representing a collMod command with the given options set on this object.

Returns
Options, as a document.
modify_collection& mongocxx::options::modify_collection::validation_criteria ( class validation_criteria  validation)

Specify validation criteria for this collection.

Parameters
validationValidation criteria for this collection.
See also
https://docs.mongodb.org/manual/core/document-validation/

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