- Schema Configuration >
- Collection Configuration
Collection Configuration¶
On this page
Configuring a Document Collection¶
You can specify collection options for documents using the store_in
macro.
This macro accepts :collection_options
argument, which can contain any collection
options that are supported by the driver.
Note
In order to apply the options, the collection must be explicitly created up-front. This should be done using Collection Management Rake Task.
Please refer to the driver collections page for the more information about collection options.
Note
Collection options depend on the driver version and MongoDB server version. It is possible that some options, like time series collections, are not available on older server versions.
Time Series Collection¶
Capped Collections¶
Set a Default Collation on a Collection¶
Collection Management Rake Task¶
If you specify collection options for a document, then the corresponding collection
must be explicitly created prior to use. To do so, use the provided
db:mongoid:create_collections
Rake task:
The create collections command also works for just one model by running in Rails console: