Reputation: 95
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:
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
Upvotes: 6
Views: 4600
Reputation: 10346
It should work better if you remove the square brackets after the IN keyword, and use a collection as the parameter.
START person=node:persons('Name:*')
MATCH person->[:Girl]->friend
WHERE person.Name IN {Names} AND friend.Hair = 'Blond'
RETURN person.Name, friend.Name
Upvotes: 12