Create a Time Series Collection
On this page
Time series collections efficiently store sequences of measurements over a period of time.
Procedure
Specify a timeField.
Specify which field should be used as the timeField
for the time-series
collection. This field must have a BSON type date.
The following fields are optional:
Field | Type | Description |
---|---|---|
metaField | string | The name of the field that contains metadata in each time series
document. The metadata in the specified field should be data that
is used to label a unique series of documents. |
granularity | string | Specifies a coarser granularity so measurements over a longer time span can be more efficiently stored and queried. The default value is If you set the |
expireAfterSeconds | number | Enables the automatic deletion of documents that are older than
the specified number of seconds. |
bucketMaxSpanSeconds | number | Specifies the maximum time span between measurements in a bucket. The value of |
bucketRoundingSeconds | number | Specifies the time interval that determines the starting timestamp for a new bucket. The value of |
For more information on time series fields, see Time Series Object Fields.
Restrictions and Limitations
The following restrictions and limitations apply when creating a time series collection:
Custom collation is the only Advanced Collection Option that can be used alongside your time series collation.
See Time Series Collection Limitations for all time series collection limitations.