Class representing the optional arguments to a MongoDB createCollection command.
More...
#include <create_collection.hpp>
|
void | capped (bool capped) |
| To create a capped collection, specify true.
|
|
void | auto_index_id (bool auto_index_id) |
| Specify false to disable the automatic creation of an index on the _id field.
|
|
void | size (int max_size) |
| A maximum size, in bytes, for a capped collection.
|
|
void | max (int max_documents) |
| The maximum number of documents allowed in the capped collection.
|
|
void | storage_engine (bsoncxx::document::view_or_value storage_engine_opts) |
| Specify configuration to the storage on a per-collection basis.
|
|
void | no_padding (bool no_padding) |
| When true, disables the power of 2 sizes allocation for the collection.
|
|
void | validation_criteria (class validation_criteria validation) |
| Specify validation criteria for this collection.
|
|
bsoncxx::document::value | to_document () const |
| Return a bson document representing the options set on this object.
|
|
Class representing the optional arguments to a MongoDB createCollection command.
◆ auto_index_id()
void mongocxx::options::create_collection::auto_index_id |
( |
bool |
auto_index_id | ) |
|
Specify false to disable the automatic creation of an index on the _id field.
- Note
- For replica sets, all collections must have autoIndexId set to true.
- Parameters
-
auto_index_id | Whether or not this collection will automatically generate an index on _id. |
◆ capped()
void mongocxx::options::create_collection::capped |
( |
bool |
capped | ) |
|
◆ max()
void mongocxx::options::create_collection::max |
( |
int |
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_documents | Maximum number of documents allowed in the collection (if capped) |
◆ no_padding()
void mongocxx::options::create_collection::no_padding |
( |
bool |
no_padding | ) |
|
◆ size()
void mongocxx::options::create_collection::size |
( |
int |
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_size | Maximum size, in bytes, of this collection (if capped) |
◆ storage_engine()
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_options | Configuration options specific to the storage engine. |
◆ to_document()
Return a bson document representing the options set on this object.
- Returns
- Options, as a document.
◆ validation_criteria()
void mongocxx::options::create_collection::validation_criteria |
( |
class validation_criteria |
validation | ) |
|
The documentation for this class was generated from the following file: