这个comment是这么说的 The primary key index of a Time Series collection is an automatically created clustered index on a server generated unique _id value for a group of documents with a unique metaField for a time span. This index and value can be seen in the corresponding system.buckets.foo collection. The _id of the document cannot currently be indexed and cannot be the primary key index for a Time Series collection like a regular collection.
1条答案
按热度按时间ohtdti5x1#
我找不到文档中明确提到的,但是没有为时间序列集合自动生成的唯一索引on_id字段。
时间序列集合的行为与普通集合类似。您可以像平常一样插入和查询数据。MongoDB将时间序列集合视为由内部集合支持的可写非物化视图。当您插入数据时,内部集合会自动将时间序列数据组织为优化的存储格式。当您创建时间序列集合时,MongoDB自动在时间字段上创建一个内部聚集索引。
示例:
现在,如果您查询
system.buckets.weather
集合,这个comment是这么说的
The primary key index of a Time Series collection is an automatically created clustered index on a server generated unique _id value for a group of documents with a unique metaField for a time span. This index and value can be seen in the corresponding system.buckets.foo collection. The _id of the document cannot currently be indexed and cannot be the primary key index for a Time Series collection like a regular collection.