Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40266

Add on modified option to $currentDate

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • Labels:
      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.

            Assignee:
            daniel.hatcher@mongodb.com Danny Hatcher (Inactive)
            Reporter:
            bryanleepartstree Bryan Lee
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: