Reputation: 1518
I'm trying to find the edge between 2 vertexes in a single query on Neptun, but something is really weird.
Here's the query
g.V().has("PRINCIPAL", "principal id", "Test User").as("principal").id().as("principal_id")
.select("principal").out().hasLabel("LICENSE").as("license").valueMap(true).as("license_vm")
.select("license").in("is attached to").as("attachments")
.select("license").inE().where(outV().hasId(select("principal").id()))
.valueMap(true)
I know it's complicated, but here's the idea:
What am I missing?
Upvotes: 1
Views: 386
Reputation: 14371
Replace the where
step on the second to last line of the query with:
filter(out().where(eq('principal')).by(T.id))
That should get it working.
The hasId
step can take either a predicate such as gt(123)
or a list of one or more ID values. That's why it works when you use the ID value.
Upvotes: 1