Docs Menu

Docs HomeMongoDB Compass

Create a Time Series Collection

On this page

  • Procedure
  • Restrictions and Limitations

Time series collections efficiently store sequences of measurements over a period of time.


From the Collections screen, click the Create Collection button.


Check the Time Series Collection option.


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:

The name of the field which 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.

The granularity field allows specifying a coarser granularity so measurements over a longer time span can be more efficiently stored and queried.

The default value is set to seconds.

The expireAfterSeconds field enables automatic deletion of documents older than the specified number of seconds.

For more information on time series fields, see Time Series Collections.


Your collection will be marked by a time series badge. On the left-hand navigation bar your time series collection will have the following icon:

Time Series Icon

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.

←  Create a Collection with Queryable EncryptionViews →