Skip to content

Commit 87b3612

Browse files
authored
Merge pull request #188895 from markjbrown/update-mongo-ttl
update mongo shell cmd
2 parents 672a2b7 + 644e22f commit 87b3612

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: cosmos-db
77
ms.subservice: cosmosdb-mongo
88
ms.devlang: csharp, java, javascript
99
ms.topic: how-to
10-
ms.date: 12/26/2018
10+
ms.date: 02/16/2022
1111
ms.custom: devx-track-js, devx-track-csharp
1212
---
1313
# Expire data with Azure Cosmos DB's API for MongoDB
@@ -18,9 +18,9 @@ Time-to-live (TTL) functionality allows the database to automatically expire dat
1818
## TTL indexes
1919
To enable TTL universally on a collection, a ["TTL index" (time-to-live index)](mongodb-indexing.md) needs to be created. The TTL index is an index on the `_ts` field with an "expireAfterSeconds" value.
2020

21-
JavaScript example:
21+
MongoShell example:
2222

23-
```js
23+
```
2424
globaldb:PRIMARY> db.coll.createIndex({"_ts":1}, {expireAfterSeconds: 10})
2525
{
2626
"_t" : "CreateIndexesResponse",

0 commit comments

Comments
 (0)