I'm trying to get Mongo to remove documents with the TTL feature however without success. Have tried many things but mongo doesn't seem to clean up.
My index:
{
"v" : 1,
"key" : {
"date" : 1
},
"name" : "date_1",
"ns" : "history.history",
"expireAfterSeconds" : 60
}
The date value from document:
"date" : "2016-09-29 11:08:46.461207",
Output from db.serverStatus().metrics.ttl:
{ "deletedDocuments" : NumberLong(0), "passes" : NumberLong(29) }
Time output from db.serverStatus():
"localTime" : ISODate("2016-09-29T11:19:45.345Z")
Only thing I suspect is the way I insert the value from Python. Could be that it's in some way wrong. I have a JSON document which contains the following element:
"date": str(datetime.utcnow()),
Any clues where the problem might lay?
Thanks, Janis