cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Graph Data Modeling: All About Relationships - Bank Transfer Example

bbrown
Node

@DavidAllen wrote a great article "Graph Data Modeling: All About Relationships" However, as a learner, I tried to make the bank transfer example work and could not figure it out. I realize I need to create the wf and c nodes, but got hung up on b:BankTransfer and b:Account
/* Much better */
MATCH (wf:Bank { name: "Wells Fargo" })
MATCH (c:Currency { name: "USD" })
CREATE (a:Account)-[:INITIATES]->
(b:BankTransfer { id: 555, time: '2pm', amount: 123 })
-[:RECEIVES]->(b:Account)
CREATE (b)-[:ORIGIN_BANK]->(wf)
CREATE (b)-[:CURRENCY]->(c)

1 ACCEPTED SOLUTION

ganesh_sharma67
Node Clone
MATCH (wf:Bank { name: "Wells Fargo" })
MATCH (c:Currency { name: "USD" })
CREATE (a:Account)-[:INITIATES]->
(b:BankTransfer { id: 555, time: '2pm', amount: 123 })
-[:RECEIVES]->(acc:Account)
CREATE (b)-[:ORIGIN_BANK]->(wf)
CREATE (b)-[:CURRENCY]->(c)

View solution in original post

1 REPLY 1

ganesh_sharma67
Node Clone
MATCH (wf:Bank { name: "Wells Fargo" })
MATCH (c:Currency { name: "USD" })
CREATE (a:Account)-[:INITIATES]->
(b:BankTransfer { id: 555, time: '2pm', amount: 123 })
-[:RECEIVES]->(acc:Account)
CREATE (b)-[:ORIGIN_BANK]->(wf)
CREATE (b)-[:CURRENCY]->(c)