I cannot get a simple iteration through Nodes to work.
My query is:
String query = "MATCH (n:Concept) WHERE n.type = 'text' RETURN (n)";
When I execute:
Result qResult = db.execute(query);
System.out.println(qResult.resultAsString());
I get:
+-----------------------------------------------------------------------------------------+
| n |
+-----------------------------------------------------------------------------------------+
| Node[2]{reference:"3306c766-4c26-44a4-8112-f5fa6cb6d226",type:"text",value:"insurance"} |
| Node[3]{reference:"3306c766-4c26-44a4-8112-f5fa6cb6d226",type:"text",value:"liability"} |
+-----------------------------------------------------------------------------------------+
2 rows
Two nodes is what I expect.
When I try either:
ResourceIterator nodes = qResult.columnAs("n");
while(nodes.hasNext()) {
:
:
}
or
while(qResult.hasNext()) {
:
:
}
The loop never executes because hasNext() returns false.
What am I missing?