I needed to extend my question Map collection separate Object values
Here is the code
I'm working with cypher in java. I wrote a query (you can see it in the answer of my question Taxi sharing scheduling in neo4j thank you Brian for your help)
after the query i wrote this code
Result userData = graphDb.execute(query);
ArrayList<Map<String, Object>> userNode = new ArrayList<>();
while(userData.hasNext()){
Map<String, Object> user = userData.next();
userNode.add(user);
System.out.println("Key: " + user.keySet());
System.out.println("Value: " + user.values());
}
and I got the results:
Key: [stops]
Value: [[{grid_item=Grid1, time=09:30}, {grid_item=Grid13, time=10:00}, {grid_item=Grid3, time=10:15}, {grid_item=Grid10, time=10:35}]]
If i use the format
map.get(stops)[0] // grid_item=Grid1, time=09:30
map.get(stops)[1] // grid_item=Grid13, time=10:00
how can i correctly translate it?
user.get(stops)[0]; //in this case i got an error