Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-04-2020 07:43 AM
Hi
I am trying to load the CSV using the following query.
load csv with headers from "file:///test.csv" as line
merge(a:Client{Name:line.TradingMember})
merge (b:Company{Name:line.WorksFor, ISIN:line.ISIN,Security:line.Security})
merge (a)-[:Employee]-(b)
with b,line
match (a:Client),(b:Company)
where b.Name=line.OwnsSymbol
merge (a)-[:Has_DebitCard{asd:line.Volume}]->(b)
I got this as output
The expected output is that the OwnsSymbol column should be used as Company Name rather than creating a new node to form a relationship with the Client node as Has_Debit. The Mapping of Has_Debit is wrong according to the CSV.
03-04-2020 07:48 AM
hey,
Im facing the same kind of problem. I'm trying to dynamically match similar string and make a relationship without creating new node !!!
03-04-2020 09:04 AM
Hello,
You should modify your query as follows:
load csv with headers from "file:///test.csv" as line
merge(a:Client{Name:line.TradingMember})
merge (b:Company{Name:line.WorksFor, ISIN:line.ISIN,Security:line.Security})
merge (a)-[:Employee]-(b)
with a, b,line
match (b:Company {Name: line.OwnsSymbol})
merge (a)-[:Has_DebitCard{asd:line.Volume}]->(b)
This is where the issue lies. You want to bring forward the results of 'a' and include these results in your WITH statement. Otherwise, you are doing a new separate query with the MATCH (a:Client) statement.
-yyyguy
All the sessions of the conference are now available online