50,530
社区成员
发帖
与我相关
我的任务
分享
public interface Result extends Iterator<Record> {
List<String> keys();
boolean hasNext();
Record next();
Record single() throws NoSuchRecordException;
Record peek();
Stream<Record> stream();
List<Record> list();
<T> List<T> list(Function<Record, T> var1);
ResultSummary consume();
}
String sqlText = "MATCH(N:WechatDepartment)-[:child]->(M:WechatDepartment) \n" +
"WHERE N.departmentId = {departmentId} \n" +
"RETURN ID(M) as id, M.departmentId as departmentId, M.name as name, M.order as order, M.enable as enable";
Result result = session.run(sqlText, paramentMap);
//方法1
List<Record> records = result.list();
System.out.println("records:" + records.size());
for (Record record : records) {
Map<String, Object> recordMap = record.asMap();
System.out.println(recordMap);
String name = record.get("name").asString();
System.out.println("name:" + name);
}
//方法2
???