I have set up a TTL index on one of the collections
key" :
{
"updated_at" : 1.0
},
"name" : "updated_at_1",
"ns" : "xxx-yyy",
"expireAfterSeconds" : 180.0,
"sparse" : true,
"background" : true
It is scheduled to expire documents every 3 minutes
My TTLMonitor thread is scheduled to run every 300 secs - 5 minutes
db.adminCommand({getParameter:1, ttlMonitorSleepSecs: 1});
{
"ttlMonitorSleepSecs" : 300,
"ok" : 1,
"operationTime" : Timestamp(1589968984, 4),
"$clusterTime" : {
"clusterTime" : Timestamp(1589968984, 4),
"signature" : {
"hash" : BinData(0,"YwsahwMVAlldgw3S02zksPGbVM0="),
"keyId" : NumberLong("6799818280593784833")
}
}
}
I have checked the admin logs as well
db.setLogLevel(1, “index”);
TTL thread is running and also looking at my index, but it’s not purging the documents
{ updated_at: 1.0 } name: updated_at_1
2020-05-20T10:09:32.873+0000 D INDEX [TTLMonitor] deleted: 0
Example of one of the document I have in my collection
{
"_id" : ObjectId("5ec4ede5f523db6eb8b98c7a"),
"session_id" : "1587992244204",
"user_id" : "XXXXXXX",
"messages" : [
],
"created_at" : NumberLong(1589964261),
"**updated_at**" : NumberLong(1589964263)
}
Now this updated_at is generated using epoch time in seconds. Please tell me how can I make it work?