Row's value with create

<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
    csvtype

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!:sweat_smile:

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

Hello @Novice :slight_smile:

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?? :grimacing:

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! :slight_smile:

Thank you! Have a nice day!!

1 Like