Re: [Neo4j] Cypher Creation of Node and Json Stringify Double Quote Property Issue

244 views
Skip to first unread message

Michael Hunger

unread,
Dec 11, 2012, 6:11:01 PM12/11/12
to ne...@googlegroups.com
That's correct. Cypher syntax is not JSON !

If you want to pass in maps, please use parameters, please use parameters anyway ! Otherwise you will generate queries that cypher cannot cache and has to re-parse everytime.

Michael

> {"query" : "CREATE (N {params});", "params" : {firstName: 'John', lastName: 'Doe'}}


Am 11.12.2012 um 19:45 schrieb acg:

> Standard convention is that property names and values are wrapped in double quotes, which Json.Stringify outputs:
>
> {"firstName":"John","lastName":"Doe"}
>
> But the cypher syntax rely's on the absence of double quotes (at least on the property names):
>
> {"query" : "CREATE (N{firstName: 'John', lastName: 'Doe'});"}
>
> Sorry if this concern has been answered before, any good recommendations on handling the matter?
>
> Thanks in advance!
>
> --
>
>

acg

unread,
Dec 12, 2012, 9:40:49 AM12/12/12
to ne...@googlegroups.com
Thanks Michael, wish it wasn't the case and thanks for the advice on the parameters.  I like the unstructured nature of the storage, wish it would allow my dynamic types to be simply passed as json without hard codes.
Reply all
Reply to author
Forward
0 new messages