Database

[{"date":"01 Aug 2020 06:26:09 GMT"}]

Query

db.collection.aggregate([/** break into tokens for processing*/{"$addFields":{"tokens":{"$split":["$date"," "]}}},/** try to parse time part and break into hh, mm, ss*/{"$addFields":{"tokens":{"$reduce":{"input":"$tokens","initialValue":[],"in":{"$cond":{"if":{$ne:[-1,{"$indexOfCP":["$$this",":"]}]},"then":{"$concatArrays":["$$value",{"$split":["$$this",":"]}]},"else":{"$concatArrays":["$$value",["$$this"]]}}}}}}},/** try to 1. parse month part and 2. convert into int*/{"$addFields":{"tokens":{$let:{vars:{tokens:"$tokens",monthArray:["dummy","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},in:{"$map":{"input":"$$tokens","as":"t","in":{"$switch":{"branches":[{"case":{"$in":["$$t","$$monthArray"]},"then":{"$indexOfArray":["$$monthArray","$$t"]}}],default:{"$convert":{"input":"$$t","to":"int","onError":"$$t"}}}}}}}}}},{"$addFields":{"parsedDate":{"$dateFromParts":{"year":{"$arrayElemAt":["$tokens",2]},"month":{"$arrayElemAt":["$tokens",1]},"day":{"$arrayElemAt":["$tokens",0]},"hour":{"$arrayElemAt":["$tokens",3]},"minute":{"$arrayElemAt":["$tokens",4]},"second":{"$arrayElemAt":["$tokens",5]}}}}},/** cosmetics*/{"$project":{"date":"$parsedDate"}},/** update back to collection*/{"$merge":{"into":"collection","on":"_id","whenMatched":"merge"}}])

Result