Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

load from csv error on Neo4j - Unexpected end of input

Tags:

neo4j

cypher

I am running a simple command - > LOAD CSV FROM "file:///csvjson.csv" on neo4j browser.

The error I am getting:

Neo.ClientError.Statement.SyntaxError: Unexpected end of input: expected whitespace, '.', node labels, '[', "=~", IN, STARTS, ENDS, CONTAINS, IS, '^', '*', '/', '%', '+', '-', '=', '~', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR or AS (line 1, column 36 (offset: 35)) "LOAD CSV FROM "file:///csvjson.csv""

I have tried many variations of this command and they do not work

Could someone please help?

like image 826
kimi86 Avatar asked Mar 04 '23 01:03

kimi86


1 Answers

That is not a complete Cypher statement.

The LOAD CSV clause requires the AS xxx term, in order to know what variable name you want to use for each row of data. Also, the Cypher statement requires a RETURN clause, since it is currently just reading data (instead of writing).

Here is an example of a minimal legal statement that just returns each row of data:

LOAD CSV FROM "file:///csvjson.csv" AS row
RETURN row
like image 69
cybersam Avatar answered Mar 05 '23 16:03

cybersam