How to use select with V()
Hello, during my traversal, i found a list of vertex ids, how can i query those vertices in the same traversal without iterating over all vertices and filter them with where ?
g.V()
.group()
.by(T.id)
.by(both().id().fold())
.unfold()
.project("d")
.by(V(select(Column.values)).label())
this is just an illustration, my query is really bigger, but the V(select()) part isn't working, any idea ?
thx
Solution:Jump to solution
Currently, and this may change in the future, the
V()
step cannot take a traversal. I think however, that you can simplify that query quite a bit.3 Replies
Solution
Currently, and this may change in the future, the
V()
step cannot take a traversal. I think however, that you can simplify that query quite a bit.I implemented a community algorithm, during an iteration I group by community all vertices in the same community then i must select the best new community depending those vertices. I will easily find something else with java, thanks
FWIW the work-around is to use the
where....by
syntax in lieu of V(select(...))
but depending on the database you are using that may, or may not, perform acceptably.