Hi everyone.
I'm working on a Java procedure.
I'm doing this:
@Procedure(name = "skynet.issue100028001", mode = Mode.READ)
@Description("Rosetta Issue 000028-001")
public Stream<MapResult> issue28return() {
String query = "MATCH (t:partition)-[p:PARAMETER_PARTITION]->(e:param_file_parameter) " +
"WITH t.ID_PK as idPartition,e.ID_PK as idPar, p.order as relac " +
"order by idPartition, relac asc " +
"WITH idPartition, collect([idPar,relac]) as list " +
"WITH idPartition as A , head(head(list)) as B " +
"RETURN " +
"toString(A) as AA, " +
"toString(B) as BB;";
return tx.execute(query).stream().map(MapResult::new);
}
when I call the procedure , the response is something like that
{
"AA": "26227",
"BB": "126110"
}
{
"AA": "26229",
"BB": "126092"
}
{
"AA": "26243",
"BB": "126051"
}
I'm trying to modify the output to get it by columns, but I can't get it.
AA BB
"26227" "126110"
"26229" "126051"
Also taking into account that for other procedures the number of output fields can vary from one procedure to another.
I would appreciate any kind of help. Thanks in advance.