You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Cosmos DB文档TTL设为-1时,变更源数据保留时长咨询

Azure Cosmos DB: Change Feed Retention When Document TTL is Set to -1

Hey there! Let's break down this common point of confusion between TTL and Change Feed behavior clearly:

First, a quick recap: Setting a document's TTL to -1 means that document will never automatically expire or be deleted by the Cosmos DB TTL mechanism — it'll stick around until you manually remove it.

Now, for the Change Feed part:

  • The Change Feed's data retention is a container-level setting, not tied to individual document TTL values. By default, Cosmos DB keeps Change Feed data for 7 days, regardless of whether your documents have TTL set to -1, a positive number, or no TTL at all.
  • If you need longer retention, you can configure the Change Feed retention period when creating your container (or update it later if needed) to a maximum of 365 days. This controls how long all change records (creates, updates, deletes) stay in the feed.
  • One key note: Even if a document has TTL=-1, any changes to that document (like updates or manual deletions) will be retained in the Change Feed for the full duration of your container's configured retention period. If you never delete the document manually, its creation/update records will stay until the Change Feed's retention window closes.

内容的提问来源于stack exchange,提问作者zile

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 06:28:25