neo4j - creating multiple labels with csv -
i trying load csv file create nodes , labels. there way add more 1 label @ same time? (i using neo4j 2.1.1)
this csv:
1,test1,hardkey,button 2,test2,touch,button 3,test3,,screen
i tried this:
load csv 'file:/users/claudia/documents/nodes.csv' csvline foreach (n in (case when csvline[2]='hardkey' [1] else[] end) | merge (p:hardkey {name: csvline[1]}) ) foreach (n in (case when csvline[2]='touch' [1] else[] end) | merge (p:touch {name: csvline[1]}) )
this works, how other column ("button" , "screen") included?
thanks lot.
like this?
see merge documentation.
load csv 'file:/users/claudia/documents/nodes.csv' csvline foreach (n in (case when csvline[2]='hardkey' [1] else[] end) | merge (p:hardkey {name: csvline[1]}) on create set p.what = csvline[3] ) foreach (n in (case when csvline[2]='touch' [1] else[] end) | merge (p:touch {name: csvline[1]}) on create set p.what = csvline[3] )
Comments
Post a Comment