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.

Enforcing relationships priority when using var-length matches

Hello,

I am pretty new to Neo4j and Cypher. From my understanding, when using variable length pattern matching, Neo4j uses DFS by default.

I have the following query:
MATCH path = (u:Egg {name: "RootEgg"})-[:Mutation1|Mutation2*0..]->(c:Egg) RETURN c, relationships(path)

Starting from a node, I want to find all the child nodes (they form a binary tree) that are related with the root node by a series of mutations (either Mutation1 or Mutation2). The thing is I want this binary tree ordered such that when using DFS to traverse the tree, Mutation 1 has priority over Mutation 2.

Is there anyway to specify this relationship priority so DFS tries to expand Mutation1 before it tries to expand Mutation2.

Thank you very much!

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online