Hi,
Trying to craft a simple query where the depth of the relationship is subject to user input.
My search phrase is
Find $numlevels levels away from $cpcstart
where $numlevels is defined as an integer
and $cpcstart is node name property key
Match p=(A:cpc{subgroup:$cpcstart})-[:Reports_to*0..$numlevels]-(:cpc)
This returns error with this explanation
Parameter maps cannot be used in MATCH patterns (use a literal map instead, eg. "{id: {param}.id}") (line 1, column 61 (offset: 60))
"EXPLAIN Match p=(A:cpc{subgroup:$cpcstart})-[:Reports_to*0..$numlevels]-(:cpc)"
Return p
Which is the start of the relationship definition.
Now if I fix the depth of relationship search to specific degree with this search phrase
Match p=(A:cpc{subgroup:$cpcstart})-[:Reports_to*0..5]-(:cpc)
Return p
This is ok.
So how do I craft this to allow the user to define the depth degree of the search?
Andy