-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Write Ops
-
None
$currentDate will set the current date regardless of whether the document was otherwise modified.
It would be helpful to have an option to set the current time only if fields other than those specified in $currentDate are changed from their original values as returned in the nModified count, similar to MySQL's ON UPDATE CURRENT_TIMESTAMP.
Using change streams or tailing oplog could accomplish such, but requires replication.
- duplicates
-
SERVER-6566 Support conditional updates: $updates
- Closed