Skip to content

Commit 4176ecf

Browse files
Merge pull request #277329 from seesharprun/patch-5
Cosmos DB | Update hyperlinks in TTL
2 parents a44de11 + 6029a2d commit 4176ecf

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.subservice: mongodb
88
ms.devlang: csharp
99
# ms.devlang: csharp, java, javascript
1010
ms.topic: how-to
11-
ms.date: 02/16/2022
11+
ms.date: 06/05/2024
1212
ms.custom: devx-track-csharp
1313
---
1414
# Expire data with Azure Cosmos DB's API for MongoDB
@@ -38,7 +38,7 @@ The output of the command includes various metadata:
3838
}
3939
```
4040

41-
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.
41+
Once the index is created, the database will automatically delete any documents in that collection that haven't been modified in the last 10 seconds.
4242

4343
> [!NOTE]
4444
> `_ts` is an Azure 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.
@@ -61,11 +61,11 @@ await collection.Indexes.CreateOneAsync(indexDefinition, options);
6161
```
6262

6363
## Set time to live value for a document
64-
Per-document TTL values are also supported. The document(s) must contain a root-level property "ttl" (lower-case), and a TTL index as described above must have been created for that collection. TTL values set on a document will override the collection's TTL value.
64+
Per-document TTL values are also supported. The document(s) must contain a root-level property "ttl" (lower-case), and a TTL index as described above must have been created for that collection. TTL values set on a document overrides the collection's TTL value.
6565

66-
The TTL value must be an int32. Alternatively, an int64 that fits in an int32, or a double with no decimal part that fits in an int32. Values for the TTL property that do not conform to these specifications are allowed but not treated as a meaningful document TTL value.
66+
The TTL value must be an int32. Alternatively, an int64 that fits in an int32, or a double with no decimal part that fits in an int32. Values for the TTL property that don't conform to these specifications are allowed but not treated as a meaningful document TTL value.
6767

68-
The TTL value for the document is optional; documents without a TTL value can be inserted into the collection. In this case, the collection's TTL value will be honored.
68+
The TTL value for the document is optional; documents without a TTL value can be inserted into the collection. In this case, the collection's TTL value is honored.
6969

7070
The following documents have valid TTL values. Once the documents are inserted, the document TTL values override the collection's TTL values. So, the documents will be removed after 20 seconds.
7171

@@ -75,13 +75,14 @@ globaldb:PRIMARY> db.coll.insert({id:1, location: "Paris", ttl: NumberInt(20)})
7575
globaldb:PRIMARY> db.coll.insert({id:1, location: "Paris", ttl: NumberLong(20)})
7676
```
7777

78-
The following documents have invalid TTL values. The documents will be inserted, but the document TTL value will not be honored. So, the documents will be removed after 10 seconds because of the collection's TTL value.
78+
The following documents have invalid TTL values. The documents are inserted, but the document TTL value won't be honored. So, the documents will be removed after 10 seconds because of the collection's TTL value.
7979

8080
```JavaScript
8181
globaldb:PRIMARY> db.coll.insert({id:1, location: "Paris", ttl: 20.5}) //TTL value contains non-zero decimal part.
8282
globaldb:PRIMARY> db.coll.insert({id:1, location: "Paris", ttl: NumberLong(2147483649)}) //TTL value is greater than Int32.MaxValue (2,147,483,648).
8383
```
8484

85-
## Next steps
86-
* [Expire data in Azure Cosmos DB automatically with time to live](../mongodb/time-to-live.md)
87-
* [Indexing your Azure Cosmos DB database configured with Azure Cosmos DB's API for MongoDB](../mongodb/indexing.md)
85+
## Next step
86+
87+
> [!div class="nextstepaction"]
88+
> [Indexing your Azure Cosmos DB database configured with Azure Cosmos DB's API for MongoDB](../mongodb/indexing.md)

0 commit comments

Comments
 (0)