RedisGraph / redisgraph-go

A Golang client for redisgraph
https://redisgraph.io
BSD 3-Clause "New" or "Revised" License
132 stars 38 forks source link

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

Open ebrahimtorabi opened 2 years ago

gkorland commented 2 years ago

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

ebrahimtorabi commented 2 years ago

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)
)