Hi Sudhir,
To help troubleshoot this can you please:
- provide the index definition (i.e. from db.collection.getIndexes() )
- provide examples of the created_at field values for documents that aren't removed?
- confirm your exact version of MongoDB (i.e. via db.version() in the `mongo` shell)
TTL indexes only work if the indexed field in a document includes a BSON date. You could also check if some of your documents have field values that aren't dates by comparing the
BSON type, eg:
db.collection.find({created_at: { $not: { $type: 9}}}).count();
Regards,
Stephen