【发布时间】:2018-12-21 16:22:35
【问题描述】:
我在 Timestamp 属性上建立了 TTL 索引,这是一个非常直接的索引。我已经使用 MongoDb .Net Driver V 2.7.2 在我的 mongo 上下文构造函数中创建了索引。 它正在按预期从给定集合中删除文档,但 MongoDBCompass 社区以及当我通过 Mongo 终端检查它时,“使用”没有更新。
<code>
Here is the out put running $indexStat:
MongoDB Enterprise > db.testCollection.aggregate( [ { $indexStats: { } } ] ).pretty()
{
"name" : "_id_",
"key" : {
"_id" : 1
},
"host" : "****:27017",
"accesses" : {
"ops" : NumberLong(15),
"since" : ISODate("2018-12-20T22:52:01.132Z")
}
}
{
"name" : "****TTLIndex",
"key" : {
"Timestamp" : -1
},
"host" : "****:27017",
"accesses" : {
"**ops" : NumberLong(0),** <----- This is zero
"since" : ISODate("2018-12-20T22:52:01.132Z")
}
}
</code>
什么可能导致使用不更新?其他集合上的其他 TTL 索引工作正常吗?
【问题讨论】:
标签: c# mongodb mongodb-.net-driver mongodb-compass