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:{times:{$getField:{field:"dayTotal",input:{$first:{$filter:{input:"$snapshots",cond:{$eq:["$$this.dayIndex",2]}}}}}}}}],{upsert:false,multi:true})

Result