@@ -18,6 +18,11 @@ store data in MongoDB and have the :binary:`~bin.mongod` automatically
1818remove data after a specified number of seconds or at a specific clock
1919time.
2020
21+ You can expire data for deployments hosted in the following
22+ environments:
23+
24+ .. include:: /includes/fact-environments.rst
25+
2126Data expiration is useful for some classes of information, including
2227machine generated event data, logs, and session information that only
2328need to persist for a limited period of time.
@@ -39,9 +44,83 @@ collection.
3944You can modify the ``expireAfterSeconds`` of an existing TTL index
4045using the :dbcommand:`collMod` command.
4146
47+ Expire Documents in the {+atlas+} UI
48+ -------------------------------------------------------
49+
50+ To expire data in the :ref:`Atlas UI <atlas-ui-overview>`, follow
51+ these steps:
52+
53+ .. procedure::
54+ :style: normal
55+
56+ .. step:: Navigate to the collection
57+
58+ a. In the {+atlas+} UI, click :guilabel:`Database` in the sidebar.
59+ #. For the database deployment that contains the data you want to
60+ expire, click :guilabel:`Browse Collections`.
61+ #. In the left navigation pane, select the database.
62+ #. In the left navigation pane, select the collection.
63+
64+ .. step:: Open the :guilabel:`Create Index` modal
65+
66+ a. Click the :guilabel:`Indexes` tab.
67+ #. Click :guilabel:`Create Index`.
68+
69+ .. step:: Create the index with the ``expiresAfterSeconds`` option
70+
71+ a. In the :guilabel:`Fields` section, enter the index key
72+ specification document. For this example, enter the
73+ following text to create an index on the
74+ ``expiresAfter`` field:
75+
76+ .. code-block::
77+
78+ { "expiresAfter": 1 }
79+
80+ b. In the :guilabel:`Options` section, enter the
81+ ``expireAfterSeconds`` option. For this example, enter the
82+ following text to expire the data 1 second after the
83+ ``expiresAfter`` field's value:
84+
85+ .. code-block::
86+
87+ { expireAfterSeconds: 1 }
88+
89+ #. Click :guilabel:`Review`.
90+ #. Click :guilabel:`Confirm`.
91+
92+ .. step:: Add a document that contains the ``expiresAfter`` field to the collection
93+
94+ a. In the left navigation pane, select the collection that
95+ contains the index.
96+ #. Click the :guilabel:`Find` tab.
97+ #. Click :guilabel:`Insert Document`.
98+ #. Click the text field under the :guilabel:`_id` field and enter
99+ the field name ``expiresAfter``.
100+ #. Click the text field next to ``expiresAfter`` and enter the
101+ following value:
102+
103+ .. code-block::
104+
105+ 2023-10-01T12:00:00.000+00:00
106+
107+ This value expires data after 12:00 on October
108+ 1, 2023.
109+ #. Click the data type drop-down menu and change the data type
110+ value to :guilabel:`Date`.
111+ #. Click :guilabel:`Insert`.
112+
113+ The document will expire automatically one second after the
114+ ``expiredAfter`` field's value.
115+
116+ The TTL index may take 1-2 seconds to expire the document.
117+ You may need to refresh the UI to see that {+atlas+} deletes
118+ the expired document.
119+
42120Expire Documents after a Specified Number of Seconds
43121----------------------------------------------------
44122
123+ You can expire data after a specified number of seconds in the terminal.
45124To expire data after a specified number of seconds has passed since the
46125indexed field, create a TTL index on a field that holds values of BSON
47126date type or an array of BSON date-typed objects *and* specify a
@@ -85,7 +164,8 @@ specified in ``expireAfterSeconds``.
85164Expire Documents at a Specific Clock Time
86165-----------------------------------------
87166
88- To expire documents at a specific clock time, begin by creating a TTL
167+ You can expire data at a specified clock time in the terminal. To
168+ expire documents at a specific clock time, begin by creating a TTL
89169index on a field that holds values of BSON date type or an array of
90170BSON date-typed objects *and* specify an ``expireAfterSeconds`` value
91171of ``0``. For each document in the collection, set the indexed date
0 commit comments