I need to get all list of vertices label of all outgoing egdes from a vertex using scala gremlin.
My code looks like below,
val names :ListBuffer[String] = ListBuffer()
val toList: List[Vertex] = graph.V().hasLabel(100).outE().outV().toList()
for(vertex <- toList){
names += vertex.label()
}
Its returning the same label name for all vertex Eg : Vertex A is having outE to B,C,D . It returns the label of A. Output:
ListBuffer(100, 100, 100)
Anything am i missing?