Time Series时间序列¶
On this page
Overview概述¶
In this guide, you can learn about time series collections in the MongoDB Node.js driver.在本指南中,您可以在MongoDB Node.js驱动程序中了解时间序列集合。
Create a Time Series Collection创建时间序列集合¶
We recommend that you create a time series collection using the MongoDB Shell (我们建议您使用MongoDB Shell(mongosh
). mongosh
)创建时间序列集合。For detailed instructions on creating a time series collection using the MongoDB Shell, see our MongoDB Manual entry on time series collections.有关使用MongoDB Shell创建时间序列集合的详细说明,请参阅MongoDB手册中关于时间序列集合的条目。
Query a Time Series Collection查询时间序列集合¶
Since you query a time series collection in the same way you query other collection types in MongoDB, the Node.js driver has no features specifically for querying time series data.由于查询时间序列集合的方式与在MongoDB中查询其他集合类型的方式相同,因此Node.js驱动程序没有专门用于查询时间序列数据的功能。
For more information on querying data in the MongoDB Node.js driver, see the following resources:有关在MongoDB Node.js驱动程序中查询数据的更多信息,请参阅以下参考资料:
MongoDB version 5.0 introduces window functions into the MongoDB aggregation framework. MongoDB 5.0版在MongoDB聚合框架中引入了窗口函数。You can use window functions to perform operations on a contiguous span of time series data. 可以使用窗口函数对连续的时间序列数据范围执行操作。For more information, see the reference documentation for the $setWindowFields aggregation stage.有关更多信息,请参阅$setWindowFields
聚合阶段的参考文档。