cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Row's value with create

Novice
Node Link

<Please keep the following things in mind:

  1. did you search for what you want to ask before posting?
  2. please use tags for additional info
  3. use a self-descriptive title

Please format code + Cypher statements with the code </> icon, it's much easier to read.

Please provide the following information if you ran into a more serious issue:

  • neo4j version, desktop version, browser version
  • what kind of API / driver do you use
  • screenshot of PROFILE or EXPLAIN with boxes expanded (lower right corner)
  • a sample of the data you want to import
  • which plugins / extensions / procedures do you use
  • neo4j.log and debug.log>
    ===========================================================================
    Hi,
    This is my csv table. And load csv file in 'neo4j browser'
    anyway I want create node with column's name. but, failed
    3X_a_8_a820a370a9cad338cc975f1a600de05bcf8471af.png

This is my failed cypher.
I wanted to give a name according to the type of change row._labels name.
Is it possible? Thank you!

LOAD CSV WITH HEADERS FROM 'file:///neo4j_data_ansi.csv' AS row
CREATE (row._labels: row._labels)
return *
1 ACCEPTED SOLUTION

I forgot the YIELD:

LOAD CSV WITH HEADERS FROM 'file:///neo4j_data_ansi.csv' AS row
CALL apoc.create.node([row._labels], {name: row.name, count: row.Count})
YIELD node
RETURN node

View solution in original post

4 REPLIES 4

Hello @Novice

You will have to use APOC plugin, for example:

LOAD CSV WITH HEADERS FROM 'file:///neo4j_data_ansi.csv' AS row
CALL apoc.create.node([row._labels], {name: row.name, count: row.Count})
YIELD node
RETURN node

Links:

Regards,
Cobra

Hi, Thank you reply !

Install APOC plugin and I was try it.
Is it wrong way??

I forgot the YIELD:

LOAD CSV WITH HEADERS FROM 'file:///neo4j_data_ansi.csv' AS row
CALL apoc.create.node([row._labels], {name: row.name, count: row.Count})
YIELD node
RETURN node

oh...!
nice work!

Thank you! Have a nice day!!