[DOCS-6666] Provide example of $push with currentDate() Created: 28/Nov/15  Updated: 30/Oct/23  Resolved: 01/Nov/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: bite-sized, docs-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: https://docs.mongodb.org/manual/reference/operator/update/currentDate/
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
Referrer: https://www.google.co.id/
Screen Resolution: 1366 x 768
repo: docs
source: reference/operator/update/currentDate


Participants:
Days since reply: 1 year, 14 weeks, 1 day ago
Epic Link: DOCSP-1769
Story Points: 0.25

 Description   

Cases like adding currentDate while doing push to an array is needed e.g.

collection.update(
            {
                '_id': user_id
            },
            {
            '$push' : {
                'projects': {
                    '_id': project_id,
                    'name': 'risky',
                    'description': "A test project for Dynamic Risk."
                },                
            },
            '$currentDate': {'projects.last_modified': True}
        })

(Which doesn't work and there is no documentation of it)



 Comments   
Comment by Education Bot [ 01/Nov/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Comment by Nic Cottrell [ 17/Jun/20 ]

We should update the summary to: Provide example of $push with $$NOW

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