Database
[{name:"jhon",msgs:[{id:1234,msg:"hi",date:"18/05/2018"},{id:1234,msg:"hello",date:"19/05/2018"}]},{name:"jeff",msgs:[{id:1235,msg:"hhh",date:"18/05/2017"},{id:1236,msg:"fffff",date:"19/05/2017"}]}]
Query
db.collection.aggregate([{$match:{name:"jhon"}},{$unwind:"$msgs"},{$sort:{"msgs.date":-1}},{$group:{_id:"$name",msgs:{$addToSet:"$msgs"}}},{$project:{_id:0}}])