Skip to content

Commit 1b0c06e

Browse files
Jak-MSseesharprun
andauthored
Update articles/cosmos-db/mongodb/mongodb-time-to-live.md
Co-authored-by: Sidney Andrews <[email protected]>
1 parent 2f7821b commit 1b0c06e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ globaldb:PRIMARY> db.coll.createIndex({"_ts":1}, {expireAfterSeconds: 10})
2525
```
2626
The command in the above example will create an index with TTL functionality.
2727

28+
The output of the command includes various metadata:
29+
30+
```output
31+
{
32+
"_t" : "CreateIndexesResponse",
33+
"ok" : 1,
34+
"createdCollectionAutomatically" : true,
35+
"numIndexesBefore" : 1,
36+
"numIndexesAfter" : 4
37+
}
38+
2839
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.
2940
3041
> [!NOTE]

0 commit comments

Comments
 (0)