convert iso date to timestamp in mongo query

后端 未结 3 786
夕颜
夕颜 2020-11-30 09:43

here is the query

[
    { 
        \"$project\": {
            \"formattedDate\": { 
                \"$dateToString\": { \"format\": \"%Y-%m-%d\", \"date\":         


        
3条回答
  •  -上瘾入骨i
    2020-11-30 10:08

    If you want to update timestamp. with the current date and time use the below query.

    db.getCollection('movie').update(
    {"applicationId":"2b5958d9629026491c30b42f2d5256fa8","type":"shortcut"},
    {$set : {userName:"vipin+testkm23052020@applozic.com",created_at: NumberLong(new Date()),"updated_at":NumberLong(new Date()),"docIndex":UUID()}}, {multi:true, upsert: false}
    )
    

提交回复
热议问题