Skip to content

Commit 8cff8d6

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-25353-current-date-updates (BACKPORT) (#1945)
* DOCSP-24951 regex updates (#1771) * DOCSP-24951-regex-updates * DOCSP-24951-regex-updates * DOCSP-24951-regex-updates * DOCSP-24951-regex-updates Co-authored-by: jason-price-mongodb <[email protected]> * DOCSP-24951 regex updates * DOCSP-25353 current date updates (#1931) * 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 5f9a518 commit 8cff8d6

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
@@ -42,6 +42,8 @@ Definition
4242
Behavior
4343
--------
4444

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

@@ -79,13 +81,15 @@ as well as updating the ``status`` field to ``"D"`` and the
7981
}
8082
)
8183

82-
After the operation, you can query the collection to verify the update:
84+
.. include:: /includes/update-current-date.rst
85+
86+
To verify the update:
8387

8488
.. code-block:: javascript
8589

8690
db.customers.find().pretty()
8791

88-
The updated document would resemble:
92+
The updated document resembles:
8993

9094
.. code-block:: javascript
9195
:copyable: false
@@ -100,6 +104,9 @@ The updated document would resemble:
100104
}
101105
}
102106

107+
The ``lastModified`` field is set to the date when
108+
:update:`$currentDate` was run in the update example shown earlier.
109+
103110
.. _currentDate-example-agg:
104111

105112
Aggregation Alternative to ``$currentDate``

0 commit comments

Comments
 (0)