Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-16-2020 02:27 AM
Hi,
For some reason when I execute a Cypher query containing character '{' I get an error.
Here is an example of a query I found in the official documentation (link😞
UNWIND [0, 1, 2] AS x
CALL {
WITH x
RETURN max(x) AS xMax
}
RETURN x, xMax
Which throws the following error:
Invalid input '{': expected whitespace, comment, namespace of a procedure or a procedure name
I tried executing the query in the neo4j browser and also by sending the query with the official neo4j driver for java, and in both situation the error is identical.
It seems I always get an error when using the '{' character in a query, except when I use it to define a node or edge body.
I am using neo4j server community edition version 3.5.14
Why do I get this error? Is '{' a meta character that is never found as is in a Cypher query?
01-16-2020 03:19 AM
Hi,
Welcome to the community!!
Please let me know what exactly are you trying to achieve?
You cannot use call for such statement and multiple return statement is also not correct. RETURN can only be used at the end of the query.
Regards
Vivek
01-16-2020 04:44 AM
Thank you for the fast reply.
I am simply trying some queries to train myself for the moment. I found the query in neo4j documentation (there), and I was curious to know what I was doing wrong.
How should one use call with an inline procedure?
01-16-2020 05:00 AM
Hi @ncdm-stldr welcome to the community!
This syntax looked a little odd to me, but it's definitely in the documentation. The documentation you linked to is for neo4j version 4. Version 4 has a number of new features, and it looks like this is one of them (that page does not exist for version 3.5 of the documentation).
So, I think if you use neo4j version 4.0 you'll have success with that example.
Hopefully that solves your issue. Welcome again!
-Mike
01-16-2020 05:09 AM
Thank you for the reply. Everything is clear now.
Next time, I'll check the version indication^^
All the sessions of the conference are now available online