Good Morning (at least where I am )
I to the following call
CALL {
WITH node1
MATCH
(node1: status)
-[ :next_status {status: "active"} ]->
(node2: status)
WITH distinct node2, node1
RETURN
CASE (NOT (node1)-[]->())
THEN (node1{ .*})
ELSE (node1{ .*, ListNextStatusleft: collect(DISTINCT node2{.*})})
END
AS RESULT_STATUS
}
But I get
Invalid input 'T': expected whitespace, comment, '.', node labels or rel types, '[', '^', '*', '/', '%', '+', '-', "=~", IN, STARTS, ENDS, CONTAINS, IS, '=', '~', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR, WHEN, AS, ',', ORDER, SKIP, LIMIT, FROM GRAPH, USE GRAPH, CONSTRUCT, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE UNIQUE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, CALL, RETURN, UNION, ';' or end of input (line 8, column 2 (offset: 161))
" THEN (node1{ .*})"
^
What I want to archiev:
At the moment (without the case)
...
RETURN (node1{ .*, ListNextStatusleft: collect(DISTINCT node2{.*})})
...
it works and I get
- Current status_12
** next_status_27
** next_status_65 - Current status_17
** next_status_34
** next_status_73
BUT if a CurrentStaus (node1) is an EndStatus (= has no NextStatus) the info about the Node is not inlcuded in the response
I need
- Current status_12
** next_status_27
** next_status_65 - Current status_69
- Current status_17
** next_status_34
** next_status_73
where 69 has NO next status
any way to achive this?
Thanks rob