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.

Passing JSON Formatted Objects to the Browser as Params

I can pass a JSON object to a cypher query using the driver... but It doesn't seem possible to pass an object to the browser using the :params function.

:params obj => { name: "eric", state: "confused" }

Any suggestions?

1 REPLY 1

The syntax for :params and :param is different. There is no top-level variable with :params.

Try:

:params { name: "eric", state: "confused" }

Then reference $name and $state in your cypher code in the browser.

If you do want a top-level variable with param and assign it a map, you can use the following syntax.

:param x => ({a: 1, b: 2})

then, you would have $x.a and $x.b

One difference I noticed between :param and :params, is that :params treats numbers as floats, thus setting a value to 1 is interpreted as 1.0.

for more info:

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online