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

Add $currentDate update modifier

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.3
    • Component/s: Write Ops
    • Labels:
      None

      Description

      Add a new update modifier where the server will fill in the date/timestamp:

      Usage:

      update({}, {$currentDate: { 
          field : true, //new Date()
          field1: {$type: "date"}, //new Date()
          field2: {$type: "timestamp"} //new Timestamp()
       }}

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: