Frage

Suppose I want to collect all bookName as follows:

x = g.V.has("books").bookName

it shows outpuat as :

=>Groovy
=>Java
=>Oracle

..

I want to create a list from the above in the following manner :

x = ["Groovy","Java","Oracle"]

How to create the above list so that I can iterate the list further ?

War es hilfreich?

Lösung

You can use the toList() method, so your query becomes:

x = g.V.has("books").bookName.toList()
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top