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.

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

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