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.

Setting a bound in regular path expression through some parameter or variable

Hi all,

I would like to set a bound in the regular path expression of the following MATCH clause

MATCH ()-[r:relation*..bound]-()

so I have tried 

:params bound => 5
MATCH ()-[r:relation*..$bound]-()

received an error saying Unexpected "\n"

I've also tried something like this

with 5 as bound
MATCH ()-[r:relation*..bound]-()

but receiving the error 'Invalid input 'bound': expected <UNSIGNED_DECIMAL_INTEGER>, "]", "{" or "$"'

Please note that I do not want to use MATCH ()-[r:relation*] due to performance hit.

1 REPLY 1

I think the depth limits are not expressions so they cannot be parameterized, except by using something like apoc.cypher.run and configuring your query.

but not limiting your start and or end nodes will make that query explode anyhow.