MATCH (c:Client)
WITH collect(c) AS clients
CALL apoc.cypher.mapParallel2('
CALL apoc.do.case([
_.type="Plain", "SET _.state=1",
_.type="Super", "SET _.state=2"
],"SET _.state=0",
{})
YIELD value
RETURN value',
{}, clients, 8) YIELD value
RETURN value.client.login as login, value.client.state as state
And I am getting:
Failed to invoke procedure `apoc.cypher.mapParallel2`: Caused by: org.neo4j.graphdb.NotInTransactionException: This transaction has already been closed.
Also, how should I escape quotes in case state is STRING
Thanks, I have done the same in the meantime. Now I hit another problem:
What if the state is String? How should I escape the quotes?
Please note that my apoc.do.case is a monster in the real use case, lots of sets as a result of complex calculation.