QuestionQ209

Design and implement data models

You have an Azure Cosmos DB for NoSQL database that contains a container named Container1.

For Container1, the DefaultTimeToLive property is set to -1.

You add an item to Container1 whose ttl property is 1000.

When will the item be automatically deleted?

  • A one second after the item is last accessed
  • B 1,000 seconds after the item is last accessed
  • C 1,000 seconds after the item is last modified
  • D never
Explanation

A container DefaultTimeToLive value of -1 enables TTL without a default expiration, while a positive item-level ttl overrides it. The ttl value is a number of seconds measured from the item's last-modified timestamp; therefore, the item expires after 1,000 seconds following its last modification.

Learn more

Community Discussion

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