QuestionQ3

Maintain an Azure Cosmos DB solution

You have an Azure Cosmos DB database that contains a container named container1.

You need to make sure items stored in container1 do not expire unless their TTL value is explicitly configured.

What should you do?

  • A Set the DefaultTimeToLive property to 0.
  • B Remove the DefaultTimeToLive property.
  • C Set the DefaultTimeToLive property to null.
  • D Set the DefaultTimeToLive property to –1.
Explanation

Setting DefaultTimeToLive to -1 enables TTL with no default expiration. Items without an explicit TTL remain indefinitely, while an item with a positive TTL value expires according to that value. A null or removed container TTL disables TTL entirely and causes item-level TTL values to be ignored.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!