Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-26-2021 07:41 AM
I've created a query in neo4j :
MATCH (x:Node)-[r*1..2]->(y:Node)
WITH x AS x, SIZE(COLLECT(DISTINCT y)) AS y
WITH CASE
WHEN y=10 THEN x.target
END AS l
return l AS target
But returns something like :
target
____
null
null
"test1"
null
null
"tes56"
...
What I want is :
target
____
"test1"
"tes56"
...
no null in entries. How can I achieve this ?
in short remove null row from where queries
Solved! Go to Solution.
04-26-2021 08:35 AM
Hello @maifeeulasad and welcome to the Neo4j community
MATCH (x:Node)-[r*1..2]->(y:Node)
WITH x AS x, size(collect(DISTINCT y)) AS y
WITH CASE WHEN y=10 THEN x.target END AS target
WHERE target IS NOT null
RETURN target
Regards,
Cobra
04-26-2021 08:35 AM
Hello @maifeeulasad and welcome to the Neo4j community
MATCH (x:Node)-[r*1..2]->(y:Node)
WITH x AS x, size(collect(DISTINCT y)) AS y
WITH CASE WHEN y=10 THEN x.target END AS target
WHERE target IS NOT null
RETURN target
Regards,
Cobra
All the sessions of the conference are now available online