Skip to content

Commit 41467d9

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-25353 current date updates (#1931) (#1942)
* DOCSP-25353-current-date-updates * DOCSP-25353-current-date-updates * DOCSP-25353-current-date-updates * DOCSP-25353-current-date-updates Co-authored-by: jason-price-mongodb <[email protected]> Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 9ef4fb2 commit 41467d9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:update:`$currentDate` sets the specified field to the date when
2+
:update:`$currentDate` was run.

source/reference/operator/update/currentDate.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Behavior
4343

4444
.. include:: /includes/fact-update-operator-processing-order.rst
4545

46+
.. include:: /includes/update-current-date.rst
47+
4648
If the field does not exist, :update:`$currentDate` adds the field to a
4749
document.
4850

@@ -82,13 +84,15 @@ as well as updating the ``status`` field to ``"D"`` and the
8284
}
8385
)
8486

85-
After the operation, you can query the collection to verify the update:
87+
.. include:: /includes/update-current-date.rst
88+
89+
To verify the update:
8690

8791
.. code-block:: javascript
8892

8993
db.customers.find()
9094

91-
The updated document would resemble:
95+
The updated document resembles:
9296

9397
.. code-block:: javascript
9498
:copyable: false
@@ -103,6 +107,9 @@ The updated document would resemble:
103107
}
104108
}
105109

110+
The ``lastModified`` field is set to the date when
111+
:update:`$currentDate` was run in the update example shown earlier.
112+
106113
.. _currentDate-example-agg:
107114

108115
Aggregation Alternative to ``$currentDate``

0 commit comments

Comments
 (0)