Can I name the result of an anonymous traversal without moving the traverser?
I can currently do the following:
I wish I could do something like this instead:
What would you recommend to me? I only want to do
__.out().has("name", "ripple")
once, because in my project this filter is much longer so there is considerable repeated code.Solution:Jump to solution
You could perhaps play around with
store
```
gremlin> g.V().hasLabel("person").
......1> has("name", "josh").
......2> where(__.out().has("name", "ripple").store('a'))....4 Replies
Solution
You could perhaps play around with
store
Thanks Kelvin, is .store('a') equivalent to .aggregate(local, 'a')? I'd like to avoid deprecated traversal steps
It is but I'm arguing we should never remove
store
and likewise reverse its deprecated status. I think store
is more discoverable than (aggregate,local...)
I agree