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.

Recursive query by condition

VlaD-T
Node Link

Hi there!

Is it possible to make a recursive query depending on conditions?
I have following graph and want to get all child Elements, where node HAS the data.

2X_2_2553dfea6f4c0508858bdd0cd1d152fd6d958614.png

1 ACCEPTED SOLUTION

VlaD-T
Node Link

Thanks for the replies!

This query worked perfect for me:

MATCH p=(n)-[r:CHILD *1..]->(c) 
WHERE n.hash = "ID_3ef8f14f-7eb6-4c58-b0bc-6a24f4ddc26a"
AND c.aframeProperty <> "null"
RETURN p Limit 1

View solution in original post

4 REPLIES 4

Could you be a bit more specific about what you mean by 'data' here? Do you want to find nodes which have at least one property?

For normal searches, this may help.

Maybe if you're looking to test against a list, the function keys() will help.

I agree some additional information is needed to help guide you to a solution. There a couple different ways you could attack this, but some additional context would be helpful.

VlaD-T
Node Link

Thanks for the replies!

This query worked perfect for me:

MATCH p=(n)-[r:CHILD *1..]->(c) 
WHERE n.hash = "ID_3ef8f14f-7eb6-4c58-b0bc-6a24f4ddc26a"
AND c.aframeProperty <> "null"
RETURN p Limit 1

If you find a solution to your question, in this case you answered your own question, be sure to mark it the response as a solution so people know the question has been solved.