Skip to main content

AI-200 practice question · Develop AI Solutions by Using Azure Data Management Services

An Azure Cosmos DB for NoSQL container that stores chat conversation records has DefaultTimeToLive set to 2592000 (30…

An Azure Cosmos DB for NoSQL container that stores chat conversation records has DefaultTimeToLive set to 2592000 (30 days). One specific conversation must be kept indefinitely, while all other items keep expiring after 30 days. What should the team do?

  • ASet the ttl property on that conversation item to -1
  • BSet the ttl property on that conversation item to null
  • CSet the ttl property on that conversation item to 0
  • DRemove the ttl property from that conversation item
Show the answer and explanation

Correct answer: A) Set the ttl property on that conversation item to -1

In Cosmos DB, an item-level ttl overrides the container's DefaultTimeToLive when the container default is set (not null). Setting an item's ttl to -1 makes that item never expire, while items without a ttl property keep the container default.

Why each option is right or wrong

  • A) Correct. When the container's DefaultTimeToLive is present and not null, an item's ttl property overrides it. An item ttl of -1 means that item never expires, and the other items still use the 30-day default.
  • B) Incorrect. Setting ttl to null on an item isn't supported. An item's ttl must be a nonzero positive integer up to 2,147,483,647, or -1 for no expiration.
  • C) Incorrect. 0 isn't a valid item TTL. The value must be a nonzero positive number of seconds, or -1 to disable expiration for the item.
  • D) Incorrect. An item without a ttl property inherits the container's DefaultTimeToLive, so it would still expire 30 days after its last modification.
Question type
Multiple choice (one answer)

Practise the full AI-200 exam

This question is one of a small free sample from the CertRidge AI-200 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.

Original question written from the official exam guide. Not affiliated with Microsoft; never copied from the real exam.