cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Search for multiple nodes with a list of properties

Hi,
I would like to be able to return multiple nodes by searching for a list of node properties (and e.g names) in one search statement. Is this issue solvable by using the Search phrase functionality, or any other known workarounds?

1 ACCEPTED SOLUTION

This was solved in the Customer support hours with the use of the split() of the input.

Examplewise with the search phrase that returns a comma separated list of customers with their relationships:

WITH $customerNumberListString AS content
WITH [i IN SPLIT(content, ",") | TOINTEGER(trim(i))] AS values

MATCH (n:Entity)
WHERE n.CustomerNumber IN values
with collect(id(n)) as nodes
CALL apoc.algo.cover(nodes)
YIELD rel
RETURN startNode(rel), rel, endNode(rel);

View solution in original post

1 REPLY 1

This was solved in the Customer support hours with the use of the split() of the input.

Examplewise with the search phrase that returns a comma separated list of customers with their relationships:

WITH $customerNumberListString AS content
WITH [i IN SPLIT(content, ",") | TOINTEGER(trim(i))] AS values

MATCH (n:Entity)
WHERE n.CustomerNumber IN values
with collect(id(n)) as nodes
CALL apoc.algo.cover(nodes)
YIELD rel
RETURN startNode(rel), rel, endNode(rel);