Time series collections efficiently store sequences of measurements over a period of time.
Limitations
The following restrictions and limitations apply when creating a time series collection:
Custom collation is the only Advanced Collection Option that you can use with your time series collection.
See Time Series Collection Limitations for all time series collection limitations.
Procedure
In Atlas, go to the Data Explorer page for your project.
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Data Explorer under the Database heading.
The Data Explorer displays.
Note
You can also go to the Clusters page, and click Data Explorer under the Shortcuts heading.
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.
Optional. Select a granularity from the dropdown.
Specify a coarser granularity so measurements over a longer time
span can be more efficiently stored and queried. The default value
is "seconds"
.
If you set the granularity
parameter, you can't set the
bucketMaxSpanSeconds
and bucketRoundingSeconds
parameters.
Optional. Specify a numeric value for the following fields.
Field | Type | Description |
---|---|---|
| number | Specifies the maximum time span between measurements in a bucket. The value of |
| number | Specifies the time interval that determines the starting timestamp for a new bucket. The value of |
| number | Enables the automatic deletion of documents that are older than the specified number of seconds. |
For more information on time series fields, see Time Series Object Fields.