Skip to content

Commit 05ea9c9

Browse files
Specify that you can pass a -1
The docs say... > you need to provide a non-zero positive number However, you can pass `-1` too. In this PR, I make this more clear.
1 parent c87b8d2 commit 05ea9c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/cosmos-db/sql/how-to-time-to-live.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ async function createcontainerWithTTL(db: Database, containerDefinition: Contain
199199

200200
In addition to setting a default time to live on a container, you can set a time to live for an item. Setting time to live at the item level will override the default TTL of the item in that container.
201201

202-
* To set the TTL on an item, you need to provide a non-zero positive number, which indicates the period, in seconds, to expire the item after the last modified timestamp of the item `_ts`.
202+
* To set the TTL on an item, you need to provide a non-zero positive number, which indicates the period, in seconds, to expire the item after the last modified timestamp of the item `_ts`. You can provide a `-1` as well when the item should not expire.
203203

204204
* If the item doesn't have a TTL field, then by default, the TTL set to the container will apply to the item.
205205

@@ -563,4 +563,4 @@ container = database.createContainerIfNotExists(containerProperties, 400).block(
563563

564564
Learn more about time to live in the following article:
565565

566-
* [Time to live](time-to-live.md)
566+
* [Time to live](time-to-live.md)

0 commit comments

Comments
 (0)