Hi new here. I am following the guide (Tutorial: Import Relational Data Into Neo4j - Developer Guides) on importing CSV files into the graph database using the Northwind products.csv file as an example.
The sample code provided in the guide is:
/ LOAD CSV WITH HEADERS FROM 'file:///products.csv' AS row
MERGE (product:Product {productID: row.ProductID})
ON CREATE SET product.productName = row.ProductName, product.unitPrice = toFloat(row.UnitPrice); / using this code takes appox. 27 ms on my machine to create the nodes and properties
I've created the exact same result using MERGE only:
/LOAD CSV WITH HEADERS FROM 'file:///products.csv' AS row
MERGE (product:Product {productID: row.ProductID, productName:row.ProductName, unitPrice:toFloat(row.UnitPrice)}) / using this code takes appox. 60 ms on my machine to create the nodes and properties
Is there an advantage or best practice in using one over the other or is it pretty much the same thing?
Thx Josh