mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
doc/edges: add erds to examples (#3268)
This commit is contained in:
@@ -32,7 +32,7 @@ func Example_O2MRecur() {
|
||||
// Output:
|
||||
// Tree leafs [1 3 5]
|
||||
// [1 3 5]
|
||||
// Node(id=1, value=2)
|
||||
// Node(id=1, value=2, parent_id=0)
|
||||
}
|
||||
|
||||
func Do(ctx context.Context, client *ent.Client) error {
|
||||
@@ -96,7 +96,7 @@ func Do(ctx context.Context, client *ent.Client) error {
|
||||
Where(node.Not(node.HasParent())).
|
||||
OnlyX(ctx)
|
||||
fmt.Println(orphan)
|
||||
// Output: Node(id=1, value=2)
|
||||
// Output: Node(id=1, value=2, parent_id=0)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user