Hi,
I've created a TTL Index on my collection "log4netlogs" and set to expire after 30 days (30*24*60*60)
> db.log4netlogs.ensureIndex({Timestamp: 1}, {expireAfterSeconds: 2592000})
> db.log4netlogs.getIndexes()
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"ns" : "AIS.log4netlogs",
"name" : "_id_"
},
{
"v" : 1,
"key" : {
"Timestamp" : 1
},
"ns" : "AIS.log4netlogs",
"name" : "Timestamp_1",
"expireAfterSeconds" : 2592000
}
]
And I ran the below command after 5-10 mins.
It doesn't seem to have expired the below document . Today's date is Oct 17th 2013 and ideally anything at least before Sept 17th 2013 should have been expired.
Can anyone please take a look at and let me know what is it that I am doing wrong.
> db.log4netlogs.find({_id:ObjectId("523267d59047311260a300ed")}).pretty()
{
"_id" : ObjectId("523267d59047311260a300ed"),
"Timestamp" : ISODate("2013-09-13T01:18:13.500Z"),
"Level" : "INFO",
"Logger" : "Test",
"Message" : "Stop Scheduler called",
"ApplicationName" : "SchedulerService",
"ComputerName" : "TEST01"
}
Thanks.
Uma