Class representing the optional arguments to a MongoDB createCollection command.
More...
#include <create_collection.hpp>
Class representing the optional arguments to a MongoDB createCollection command.
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. |
void mongocxx::options::create_collection::capped |
( |
bool |
capped | ) |
|
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) |
void mongocxx::options::create_collection::no_padding |
( |
bool |
no_padding | ) |
|
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) |
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. |
Return a bson document representing the options set on this object.
- Returns
- Options, as a document.
void mongocxx::options::create_collection::validation_criteria |
( |
class validation_criteria |
validation | ) |
|
The documentation for this class was generated from the following file: