Database

[{name:"David",contacts:{friend_1:"Bill",friend_2:"George",friend_3:"Donald",friend_4:"Richard",managaer:"James",mentor:"Andy"}}]

Query

db.collection.aggregate([{"$set":{"contacts":{"$objectToArray":"$contacts"}}},{"$project":{"name":1,"contacts":{"$filter":{"input":"$contacts","as":"c","cond":{"$regexMatch":{"input":"$$c.k","regex":".*friend.*","options":"i"}}}}}},{"$set":{"contacts":{"$arrayToObject":"$contacts"}}}])

Result