3 timeField: "date", 4 metaField: "symbol", 5 granularity: "minutes" } }) Each document that you add to the time series collection will need to specify at least the timeField. In the example document below, the
timeField: "ts", metaField: "source", granularity: "minutes" }, expireAfterSeconds: 9000 }); 其中: timeField字段为时序字段,其类型必须为MongoDB支持的时间类型比如ISODate("2021-05-20T10:24:51.303Z")。 metaField为元数据字段,可用来创建二级索引,比如标记时序数据的来源等。MongoDB会自动将一段时...
TTL (Time To Live) is a special option that we can apply only to a single field index to permit the automatic deletion of documents after a certain time. During index creation, we can define an expiration time. After that time, all the documents that are older than the expiration time w...
//New date operators $dateAdd, $dateSubtract, $dateTrunc, $dateDiff, all of which can be used as SQL functions mb.runSQLQuery(` SELECT dateAdd(startDate='$purchaseDate', unit='day', amount=3, timezone='America/New_York') as DATE_ADD, dateSubtract(startDate='$purchaseDate', unit='da...
SERVER-67622 Optimize timeseries_dotted_path_support functions SERVER-69244 $merge fails when session default read concern has been set to "majority" SERVER-71819 Broadcast collMod command to all shards SERVER-73430 Improve Hash, HMAC, and Crypto algo lookup for OpenSSL 3.0 SERVER-74033 Remove iden...
In this case, MongoDB will drop the documents from the collection automatically once half an hour (1800 seconds) has passed since the value inlastUpdateTimefield. Restrictions: Only single field indexes can have the TTL option the_idsingle field index cannot support the TTL option ...
SERVER-77382 Null embedded metaField for creating a time-series collection leads to invalid BSON index spec SERVER-77615 Date subtract operation doesn't work correctly on NaN operand in classic engine SERVER-77862 Exclude compact.js from running in macos variants SERVER-78369 ignoreUnknownIndexOptions...