Database

[{"name":"name","address":"address","times":10,"snapshots":[{"dayTotal":2,"dayHit":2,"dayIndex":2},{"dayTotal":3,"dayHit":3,"dayIndex":3}]}]

Query

db.collection.update({},[{$set:{snapshotForDayIndex2:{$first:{$filter:{input:"$snapshots",cond:{$eq:["$$this.dayIndex",2]}}}}}},{$set:{times:"$snapshotForDayIndex2.dayTotal"}},{$unset:"snapshotForDayIndex2"}],{upsert:false,multi:true})

Result