Do you know :param jsontype => {akey: 'avalue'} doesn't work?(at least on my laptop with the latest neo4j desktop/windows10)

After a little digging on parameters, I can confirm a few things

  • :param variableName => 'simple value' works as documented (simple data e.g. integer, string, float)
  • :param variableName => {mapStructureData: 'test'} does not work (for maps)
  • :param variableName : {complexMap: 'test'} does appear to work (with maps) However, if this is the correct syntax to use, I could not find it anywhere in the documentation, or in community discussions. (though there are a few interesting discussions)

Notes:

  • I believe you are referring to the Neo4j browser only (and not how to use parameters from a language) I mention this because some of the documentation mixes the two topics (which can lead to confusion, I agree).
  • The syntax for :param has changed over time... With a distinct change from 3.5 to 4.x (which could also lead to confusion, and gaps in documentation)

The old parameter syntax {param} was deprecated in Neo4j 3.0 and removed entirely in Neo4j 4.0. Using it will result in a syntax error. However, it is still possible to use it, with warnings, if you prefix the query with CYPHER 3.5 . See Cypher Compatibility for further information.

1 Like