I have two gremlin queries. I want to filter out the output of one query based on the results of another query.
For example,
query 1: g.V().hasLabel('Person').values('name')
gives the following output - John, Sam, Rocky
query 2: g.V().hasLabel('Friend').values('name')
gives the following output - John
So, the final expected output I want is John
I have tried the following:
g.V().hasLabel('Person').where('names', g.V().hasLabel('Friend').values('name'))
But it doesn't seem to be working. Can anyone please help me here?