You can use the toList() method, so your query becomes:
x = g.V.has("books").bookName.toList()
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 ?
Lösung
You can use the toList() method, so your query becomes:
x = g.V.has("books").bookName.toList()