redisgraph-go icon indicating copy to clipboard operation
redisgraph-go copied to clipboard

redisgraph do not support foreach and i need use "case when then" with foreach.What do you suggest instead?

Open ebrahimtorabi opened this issue 3 years ago • 2 comments

ebrahimtorabi avatar Jan 24 '22 13:01 ebrahimtorabi

@ebrahimtorabi can you please share a sample query you would like to use foreach with?

gkorland avatar Jan 25 '22 13:01 gkorland

thanks. i need create or merge conditionally for example:

FOREACH(ignoreMe IN CASE WHEN 'y' THEN [1] ELSE [] END | 
    MERGE (u)-[r2:STAGE {startdate:20141225, enddate:'99999999', status:'InProgress'}]->(b2 {fork:'fail'})
)
FOREACH(ignoreMe IN CASE WHEN NOT 'y' THEN [1] ELSE [] END | 
    MERGE (u)-[r2:STAGE {startdate:20141225, enddate:'99999999', status:'InProgress'}]->(b2)
)

ebrahimtorabi avatar Jan 25 '22 15:01 ebrahimtorabi