Although one of the most common use cases for demonstrating the capabilities of a graph database, I cannot seem to find a good example or best practice for obtaining \"friends o
This should be much simpler:
select expand(
bothE('is_friend_with')[status = 'approved'].bothV()
.bothE('is_friend_with')[status = 'approved'].bothV()
) from user where uuid = '95920a96a60c4d40a8f70bde98ae1a24'
With bothE() and then bothV() you get both in/out connections at edge/vertex level.
In order to exclude current user you could use:
select expand(
bothE('is_friend_with')[status = 'approved'].bothV()
.bothE('is_friend_with')[status = 'approved'].bothV()
.remove( @this )
) from user where uuid = '95920a96a60c4d40a8f70bde98ae1a24'