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

Add $currentDate update modifier

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.3
    • None
    • Write Ops
    • 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

        Activity

          People

            greg.mckeon@mongodb.com Gregory McKeon (Inactive)
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: