Database
[{"name":"$1 STORE","address":"5573 ROSEMEAD BLVD","city":"TEMPLE CITY","zipcode":"91780","state":"California","violations":[{"inspection_date":"2015-09-29","description":" points ... violation_status\n62754 1 ... OUT OF COMPLIANCE\n62755 1 ... OUT OF COMPLIANCE\n62756 2 ... OUT OF COMPLIANCE\n\n[3 rows x 5 columns]","risk":"Risk 3 (Low)"},{"inspection_date":"2016-08-18","description":" points ... violation_status\n338879 2 ... OUT OF COMPLIANCE\n\n[1 rows x 5 columns]","risk":"Risk 3 (Low)"}/**could be more than 2 or less then 2 object inside violations array//]}*/]}]
Query
db.collection.aggregate([{"$addFields":{"violations":{"$map":{"input":"$violations","in":{"$mergeObjects":["$$this",{"inspection_date":{"$dateFromString":{"dateString":"$$this.inspection_date","format":"%Y-%m-%d","onError":null,"onNull":null}}}],},}}}},])