Modeling data for Internet of Things
Internet of things (IoT) is one of the most quickly growing industries and this comes with unique challenges around data storage and processing. IoT systems typically use multiple sensors to gather data that needs to be stored, analyzed, and processed in near real time.
MongoDB introduced time series collections in version 5.0 and greatly extended supported functionality in version 6. These are special collections that are faster for data series that can contain sensor measurements.
For example, to create a time series collection, stocks with a timeField
field of “timestamp”
, and using the default granularity of “seconds”
(or “minutes”
, “hours”
, et cetera) would require the following mongo shell command:
db.createCollection( "stocks", { timeseries: { ...