Hello,
While playing with queries using Neo4j Browser, sometimes is helpful to set query parameters in advance so those variables can be easily changed without modifying the query itself. I could do that with simple parameters or even maps:
:param {
personName: "Val Kilmer",
movieTitle: "Top Gun"
}
But, when I try to nest maps inside a list like the below I get a syntax error:
:param items => [
{
personName: "Val Kilmer",
movieTitle: "Top Gun"
},
{
personName: "Tom Cruise",
movieTitle: "Top Gun"
}
]
// Returns
Syntax error at line 2 col 0:
{
^
Unexpected "\n".
Funny enough, it works while running the command in a single-line way:
:param items => [{personName: "Val Kilmer", movieTitle: "Top Gun"}, {personName: "Tom Cruise", movieTitle: "Top Gun"}]
Although, whenever I need to set many query parameters, the single-line approach above lacks readability.
Does anyone how to set a list of maps using that ":param" command in a multiline way?
Thank you.