Skip to content

Commit 2f7821b

Browse files
author
Sandeep Nair
committed
response was shown as part of command, removed response
1 parent cc9e24e commit 2f7821b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

articles/cosmos-db/mongodb/mongodb-time-to-live.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: MongoDB per-document TTL feature in Azure Cosmos DB
3-
description: Learn how to set time to live value for documents using Azure Cosmos DB's API for MongoDB to automatically purge them from the system after a period of time.
3+
description: Learn how to set time to live value for documents using Azure Cosmos DB's API for MongoDB, to automatically purge them from the system after a period of time.
44
author: gahl-levy
55
ms.author: gahllevy
66
ms.service: cosmos-db
@@ -22,16 +22,10 @@ MongoShell example:
2222

2323
```
2424
globaldb:PRIMARY> db.coll.createIndex({"_ts":1}, {expireAfterSeconds: 10})
25-
{
26-
"_t" : "CreateIndexesResponse",
27-
"ok" : 1,
28-
"createdCollectionAutomatically" : true,
29-
"numIndexesBefore" : 1,
30-
"numIndexesAfter" : 4
31-
}
3225
```
26+
The command in the above example will create an index with TTL functionality.
3327

34-
The command in the above example will create an index with TTL functionality. Once the index is created, the database will automatically delete any documents in that collection that have not been modified in the last 10 seconds.
28+
Once the index is created, the database will automatically delete any documents in that collection that have not been modified in the last 10 seconds.
3529

3630
> [!NOTE]
3731
> `_ts` is a Cosmos DB-specific field and is not accessible from MongoDB clients. It is a reserved (system) property that contains the timestamp of the document's last modification.

0 commit comments

Comments
 (0)