File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ of time or at a specific clock time. Data expiration is useful for certain types
29
29
like machine generated event data, logs, and session information that
30
30
only need to persist in a database for a finite amount of time.
31
31
32
+ .. warning::
33
+
34
+ After you create a TTL index, it might have a very large number of
35
+ qualifying documents to delete at once. This large workload might
36
+ cause performance issues on the server. To avoid these issues, plan
37
+ to create the index during off hours, or delete qualifying documents
38
+ in batches before you create the index for future documents.
39
+
32
40
To create a TTL index, use the :method:`~db.collection.createIndex()`
33
41
method on a field whose value is either a :ref:`date
34
42
<document-bson-type-date>` or an array that contains :ref:`date values
You can’t perform that action at this time.
0 commit comments