Database
[{sender:"Three",recipient:"One",createdAt:ISODate("2014-01-01T08:00:00Z")},{sender:"Two",recipient:"One",createdAt:ISODate("2014-02-15T08:00:00Z")},{sender:"One",recipient:"Two",createdAt:ISODate("2014-02-16T12:05:10Z")}]
Query
db.collection.aggregate([{$match:{$or:[{sender:"One"},{recipient:"One"}]}},{$addFields:{other:{$cond:{if:{$eq:["$recipient","One"]},then:"$sender",else:"$recipient"}}}},{$sort:{createdAt:1}},{$group:{_id:"$other",createdAt:{$last:"$createdAt"},recipient:{$last:"$recipient"},sender:{$last:"$sender"}}},{$project:{_id:0,recipient:"$recipient",sender:"$sender",createdAt:"$createdAt"}}])