neo4j apoc - extraneous input '('

255 views Asked by At

what am I doing wrong with the query

WITH [1] AS a, [2] AS b
RETURN apoc.coll.union(a,b);

Although it returns the result ([1,2]) In the browser it keeps telling me extraneous input '(', expecting...

Is this a problem or just "Lint garbage"? I am trying to identify a problem with another query where the same Lint message pops up in the same kind of use of the apoc function.

1

There are 1 answers

3
Bruno Peres On

EDIT:

As discussed in the comments, CALL is not appropriate to functions (like apoc.coll.union). So I believe this behavior is a bug in the lint of Neo4j Browser. I opened an issue in the Neo4j Browser repo.

ORIGINAL ANSWER:

I believe the problem is that a user defined procedure (like apoc.coll.union) should be called with CALL and not after the RETURN statement. You can try something like:

WITH [1] AS a, [2] AS b
CALL apoc.coll.union(a,b) as r
RETURN r