Subject: Index Issue with MongoDB Collection
Hi Team,
We have a schema X that contains collection Y. Here is an example of a document:
{
"_id": ObjectId('XXX'),
"artifact": "XX-YY",
"date": 1730509200015,
"fileName": "google",
"logFile": "a5c9.gz",
"version": "1",
"date_created": ISODate('2024-11-02T01:00:00.015Z'),
"originalFilenames": ["google"],
"platforms": ["viewer"],
"requestsCounter": 90,
"responseSize": 16,
"url": "/services/editor.html"
}
The indexes on this collection are as follows:
[
{ "v": 2, "key": { "date": 1 }, "name": "date_1" },
{ "v": 2, "key": { "_id": 1 }, "name": "_id_" },
{
"v": 2,
"key": { "date_created": -1 },
"name": "date_created_-1",
"background": true,
"expireAfterSeconds": 864000
}
]
The Problem:
The index date_created_-1
does not delete old documents (older than 864000 seconds). We have tried dropping and recreating this index. Our MongoDB version is 6, and we upgraded this cluster from version 4.4. Since the upgrade, we have encountered this issue. The size of the collection has increased to 1.5TB.
How can we fix this? Could it be related to the upgrade? This issue did not occur in our other clusters.
Please advise.