[DOCS-6000] Comment on: "manual/reference/operator/update/currentDate.txt" Created: 08/Aug/15  Updated: 03/Nov/17  Resolved: 08/Aug/15

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Meteor/MongoDb

Location: http://docs.mongodb.org/manual/reference/operator/update/currentDate/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36 Vivaldi/1.0.233.3
Referrer: https://www.google.nl/
Screen Resolution: 1280 x 1024
repo: docs
source: reference/operator/update/currentDate


Participants:
Days since reply: 8 years, 27 weeks, 4 days ago

 Description   

I am missing a way to use $currentDate in the insert part of an update statement, I want a creation date if this record is currently being created.



 Comments   
Comment by Kay Kim (Inactive) [ 08/Aug/15 ]

Emailed user about the upsert: true option that belongs to the update method:

db.users.update( { _id: 1 },    {   $currentDate: {  lastModified: true  },   $set: {   status: "D", "reason": "user request"  }  } , { upsert: true } )

Generated at Thu Feb 08 07:51:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.