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.

Load CSV with Column Headers as property and values

rcfro2
Node Clone

Is there a way to load a csv with the column headers as the properties of a certain node label and the corresponding values to each row without having to explicitly list it out:

So instead of below:

LOAD CSV WITH HEADERS FROM "some_csv.csv" AS row
CREATE (n:Example)
SET n = row,
n.unitPrice = toFloat(row.unitPrice),

Have something where it implicitly sets the Column headers to the respective row value ?

1 REPLY 1

Not really sure what you're asking for.

In your example the SET n = row sets the properties to the values?

In apoc.load.csv you can provide converters for columns and then set the resulting map directly on a node without individual conversions if that helps.