Hi,
I have a same dataset using
"""LOAD CSV WITH HEADERS FROM 'file:///{}' AS row
CREATE(n:{})
SET n=row;""".format(source_path+file_name,table_name)
the above query i have done initial load of dataset.
for the second load (in which i have few new records+updated records) from existing table,
how could i load the second set of data into the same table.
I tried to use match and merge query.
"""LOAD CSV WITH HEADERS FROM 'file:///{}' AS row
WHERE row.customer_id IS NOT NULL
MERGE(c:initial_load_customer
{customer_id:row.customer_id})""".format(source_path+file_name)
i got an error message as
Traceback (most recent call last):
File "C:/Users/lenovo/PycharmProjects/header comparison/csv_neo4j.py", line 27, in
MERGE(c:initial_load_customer {customer_id:row.customer_id})""".format(source_path+file_name)
KeyError: 'customer_id'
Do my second load query is wrong or else is there any way i can create a node if id doesnt exist, else if node exist update(update all the columns with values in recent file) the node with property available in csv file.