I am trying to do call a cypher query (in java) passing in parameters to do something like:
WHERE node.property IN [{param}]
Full example:
START person=node:persons('Name:*')
MATCH person->[:Girl]->friend
WHERE person.Name IN [{Names}] AND friend.Hair = 'Blond'
RETURN person.Name, friend.Name
For the parameter I have tried using the following:
- Collection containing strings
- Array containing strings
- Delimited string like “‘Joe Blow’, ‘Blow Joe'”
I really thought the last one would work but I think the parameter is being replaced as a single string i.e. [“‘Joe Blow’, ‘Blow Joe'”] and not [‘Joe Blow’, ‘Blow Joe’]. I proved this by passing in one value, and that worked.
I tried tracing through the code but got lost in scala.
Any other options, thoughts?
Cheers
It should work better if you remove the square brackets after the IN keyword, and use a collection as the parameter.