Con l'ultima versione di Mongo 3.4 puoi utilizzare $graphLookup per identificare la relazione.
db.Friends.aggregate([{
$match: {
user: 'Jim'
}
}, {
$graphLookup: {
from: 'Friends',
startWith: '$user2',
connectFromField: 'user2',
connectToField: 'user',
maxDepth: 0,
as: 'relationship'
}
}, {
$project: {
_id: 0,
user: '$user2',
friends_with_me: {
$cond: [{
$eq: [{
$size: "$relationship"
}, 0]
}, false, true]
}
}
}])