This quick start describes how to configure, create, and query a time series collection with MongoDB Atlas or a self-managed deployment.
Time required: 30 minutes
Sample Data
This quick start creates a stocks
time series collection with the
following document structure.
{ _id: ObjectId(...), ticker: <string>, date: ISODate(...), close: <double>, volume: <double> }
Learning Summary
This quick start focused on creating a new time series collection. Because time series collections are optimized for time data, their performance depends heavily on how you configure them at creation. For more information, see Time Series Collection Considerations.
Next Steps
To migrate existing data into a time series collection, see Migrate Data into a Time Series Collection.
To shard a time series collection, see Shard a Time Series Collection.
For aggregation and query behaviors specific to time series collections, see Aggregation and Operator Considerations.
Learn More
To learn more about how MongoDB stores time series data internally, see About Time Series Data.
To learn more about custom bucketing parameters in MongoDB 6.3 and later, see Using Custom Bucketing Parameters.