I'm modeling a social network where users follow others. I'm trying to generate a list of potential users to follow and order it by those who are also followed by the people I'm following (let's call these 'mutualFollowers' for lack of a better term).
My current query does this by getting all users who are followed by the users that "myusername" follows (edges "following" from userOne --> userTwo) and removing those who the user "myusername" already follows (the aggregated group "following" here).
g.V().has("user", "username", "myusername").out("follows").aggregate("following").out("follows").where(without("following")).groupCount().by("username").order(local).by(values, decr).next()
I can correctly generate this list, but I am only able to get a list with entries like
username: 5
(where username is the username and 5 is the number of mutual followers)
I would also like to be able to select other properties of each user vertex like "name", "profile_pic", etc in some form similar to
{username: username, name: personName, mutualFollowers: 10}
Is there an easy way to do this?
(using AWS Neptune)