我需要扩展我的问题Map collection separate Object values
这是代码
我在java中使用cypher。我写了一个查询(你可以在我的问题的答案中看到它Taxi sharing scheduling in neo4j谢谢Brian的帮助)
在查询之后我写了这段代码
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());
}
我得到了结果:
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}]]
如果我使用格式
map.get(stops)[0] // grid_item=Grid1, time=09:30
map.get(stops)[1] // grid_item=Grid13, time=10:00
我怎样才能正确翻译它?
user.get(stops)[0]; //in this case i got an error