From efebb8823cc17513ff6697f31ad66b96e92af1f3 Mon Sep 17 00:00:00 2001 From: Andrew Feierabend Date: Wed, 27 Jan 2021 16:04:28 -0500 Subject: [PATCH] DOCSP-14170 clarify TTL index requirements --- source/core/index-ttl.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/core/index-ttl.txt b/source/core/index-ttl.txt index dd78be1d1b7..9e5d25de73d 100644 --- a/source/core/index-ttl.txt +++ b/source/core/index-ttl.txt @@ -29,14 +29,15 @@ of time or at a specific clock time. Data expiration is useful for certain types like machine generated event data, logs, and session information that only need to persist in a database for a finite amount of time. -To create a TTL index, use the :method:`db.collection.createIndex()` -method with the ``expireAfterSeconds`` option on a field whose value is -either a :ref:`date ` or an array that -contains :ref:`date values `. +To create a TTL index, use the :method:`~db.collection.createIndex()` +method on a field whose value is either a :ref:`date +` or an array that contains :ref:`date values +`, and specify the ``expireAfterSeconds`` +option with the desired TTL value in seconds. For example, to create a TTL index on the ``lastModifiedDate`` field of -the ``eventlog`` collection, use the following operation in the -:binary:`~bin.mongo` shell: +the ``eventlog`` collection, with a TTL value of ``3600`` seconds, use +the following operation in the :binary:`~bin.mongo` shell: .. code-block:: javascript