织梦CMS - 轻松建站从此开始!

欧博ABG官网-欧博官方网址-会员登入

Azure cosmosDB does not delete documents with expi

时间:2025-09-02 16:32来源: 作者:admin 点击: 14 次
I have a collection in an Azure cosmosDB, where I enabled the Time To Live (TTL) feature with no defaults. As per the , which I will refer to in this

I have a collection in an Azure cosmosDB, where I enabled the Time To Live (TTL) feature with no defaults.

As per the , which I will refer to in this question, everything seems crystal clear but there is still something I am missing, because after 5 days I still can see documents with a TTL of 300 seconds.

Below the screenshot showing the collection settings, where the TTL is enabled with no default.

enter image description here

According with the documentation:

Azure Cosmos DB will automatically remove these items after the time period, since the time they were last modified. Time to live value is configured in seconds. When you configure TTL, the system will automatically delete the expired items based on the TTL value, without needing a delete operation that is explicitly issued by the client application.

But this doesn't seem to apply in my case, where on the 17/07/2019 I can see a document oder than 5 days, using a TTL of 300 seconds (5 minutes).

{ "ClientEnqueuedUtcTime": "2019-07-12T06:49:53.844", "ClientDispatchedUtcTime": "2019-07-12T06:49:53.844", "ServerEnqueuedUtcTime": "2019-07-12T06:49:53.8949771", "ServerDispatchedUtcTime": "2019-07-12T06:49:54.3659741", "TTL": 300, "EventProcessedUtcTime": "2019-07-12T06:49:55.3583521Z", "PartitionId": 2, "EventEnqueuedUtcTime": "2019-07-12T06:49:55.25Z", "id": "4a0edf24-6a86-4a59-f55d-d7dfe47c30fa", "_rid": "SBk4AJadUE6gAgEAAAAAAA==", "_self": "dbs/SBk4AA==/colls/SBk4AJadUE4=/docs/SBk4AJadUE6gAgEAAAAAAA==/", "_etag": "\"00008f1d-0000-0200-0000-5d282d930000\"", "_attachments": "attachments/", "_ts": 1562914195 }

UPDATE After the answer

I tried to salve the TTL in lower case format, but it was transformed uppercase automatically, so I don't think it is a case mismatch with the expected TTL key.

Am I supposed to do or try anything else?

SOLUTION:

ttl is indeed case sensitive, and you can set it lowercase, in the test I done for some reason the ttl was still uppercase, when I was expecting it to be lower, so I tough incorrectly that was some kind of reserved key.

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-09-13 19:09 最后登录:2025-09-13 19:09
栏目列表
推荐内容