[DOCS-13059] Investigate changes in SERVER-42007: Deprecate $currentDate update modifier Created: 26/Sep/19  Updated: 30/Oct/23  Resolved: 24/Jan/20

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-42007 Deprecate $currentDate update modifier Backlog
Participants:
Days since reply: 1 year, 42 weeks, 6 days ago
Epic Link: DOCS: 4.4 Server Release Work

 Description   

Description

Downstream Change Summary

The $currentDate update operator is being deprecated for MongoDB 4.4. As an alternative users can rewrite their updates using updates with aggregation pipelines and can use the $$NOW and $$CLUSTER_TIME aggregation system variables to access the current wall-clock and cluster time.

In the following example, a document is updated using pipeline updates and $$NOW:

> db.test.insert({_id: 1, value: null, lastUpdated: null})
WriteResult({ "nInserted" : 1 })
> db.test.find()
{ "_id" : 1, "value" : null, "lastUpdated" : null }
> db.test.update({_id: 1}, [{$set: {value: 1, lastUpdated: "$$NOW"}}])
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.test.find()
{ "_id" : 1, "value" : 1, "lastUpdated" : ISODate("2019-10-01T13:27:55.583Z") }

Description of Linked Ticket

This can be better expressed using $$NOW and $$CLUSTER_TIME within a pipeline-style update and having two ways to do the same thing is confusing.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Jess Mokrzecki [ 14/Apr/22 ]

Fix Version updated for upstream SERVER-42007:

Comment by Githook User [ 24/Jan/20 ]

Author:

{'username': 'kay-kim', 'name': 'Kay Kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-13059: 4.4 deprecate $currentDate
Branch: master
https://github.com/mongodb/docs/commit/55057e64f8c8112be35560ee8d6e603baec414a3

Comment by James Wahlin [ 26/Sep/19 ]

As part of this ticket please consider adding examples to our documentation that include use of $$NOW and $$CLUSTER_TIME. There is a blog post referencing $$NOW, but it does not appear to have much visibility in our docs.

Comment by Ravind Kumar (Inactive) [ 26/Sep/19 ]

Another early trigger! Future assignee, please review the upstream server ticket BEFORE starting work.

Generated at Thu Feb 08 08:06:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.