[DRIVERS-743] Deprecate $currentDate update modifier Created: 26/Sep/19  Updated: 20/Feb/20  Resolved: 20/Feb/20

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-42007 Deprecate $currentDate update modifier Backlog
depends on CSHARP-2767 Deprecate $currentDate update modifier Closed
depends on JAVA-3451 Deprecate $currentDate update modifier Closed
Related
related to SERVER-46247 Revert deprecation of $currentDate up... Closed
Driver Compliance:
Key Status/Resolution FixVersion
JAVA-3451 Fixed 4.1.0
CSHARP-2767 Won't Do

 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.



 Comments   
Comment by Jeffrey Yemin [ 20/Feb/20 ]

Looks like this change is being rolled back. I'm going to re-open the already-closed JAVA ticket and revert the change in the Java driver. And close the CSHARP ticket.

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