GO-Client | Best-Practice creating Edges between two nodes.
Is there a best practice example somewhere ?
GO-Client | Best-Practice creating Edges between two nodes.
Is there a best practice example somewhere ?
From the DGO docs: dgo package - github.com/dgraph-io/dgo - Go Packages
Where in the go client docs is an example to edges rn im adding edges through mutation tags
If you open the “Example (Set Object)” dropdown, you’ll see this:
p := Person{
Uid: "_:alice",
Name: "Alice",
Age: 26,
Married: true,
Location: loc{
Type: "Point",
Coords: []float64{1.1, 2},
},
Dob: &dob,
Raw: []byte("raw_bytes"),
Friends: []Person{{
Name: "Bob",
Age: 24,
}, {
Name: "Charlie",
Age: 29,
}},
School: []School{{
Name: "Crown Public School",
}},
}
Notice the population of the ‘Friends’ attribute, which corresponds to a relationship being created between Alice and Bob.