英文:
How to see bucket structure that gets stored for the timeseries data in mongoDB
问题
我已经为天气数据创建了一个时间序列集合。
db.createCollection(
"weather",
{
timeseries: {
timeField: "timestamp",
metaField: "metadata",
granularity: "hours"
}
}
)
当我检索数据时,我得到了我存储的数据,但MongoDB以不同的方式存储这些数据。它基于metaField
和granularity
创建存储桶。
如何查看这些原始存储桶?
英文:
I have created a timeseries collection for weather data.
db.createCollection(
"weather",
{
timeseries: {
timeField: "timestamp",
metaField: "metadata",
granularity: "hours"
}
}
)
When I retrieve the data I get the data as I stored it, but mongoDB stores these data in different way. It creates buckets based on metaField
and granularity
.
How to see those original buckets?
答案1
得分: 1
MongoDB 将时间序列集合视为由内部集合支持的可写的非物化视图。
MongoDB 在使用 <database>.system.*
命名空间的集合中存储系统信息,MongoDB 保留该命名空间供内部使用。
system.buckets
存储与时间序列集合关联的底层数据,以一种经过优化的格式和模式存储,以有效表示已持久化的时间序列数据。
在您的情况下,它将是 system.buckets.weather
集合。
英文:
MongoDB treats time series collections as writable non-materialized views backed by an internal collection.
MongoDB stores system information in collections that use the <database>.system.*
namespace, which MongoDB reserves for internal use.
system.buckets
stores the underlying data associated to a time series collection in an optimized format and schema for an efficient representation of the persisted time series data.
In your case, it will be system.buckets.weather
collection.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论