Immutable solution version
How to update a nested object in EdgeDB?
Complete solution
How to update a nested object in EdgeDB?: You can filter based on the backlink like this: ``` select Bar filter .'df492862-80aa-11ed-832e-e72d12452736'; ``` Where `df492862-80aa-11ed-832e-e72d12452736` is the ID of your `Foo` object.
You can filter based on the backlink like this: `` select Bar filter .'df492862-80aa-11ed-832e-e72d12452736'; Where df492862-80aa-11ed-832e-e72d12452736 is the ID of your Foo object. That means you can update like this: update Bar filter .'df492862-80aa-11ed-832e-e72d12452736' set { baz := false };
Context: Stack Overflow #74501898 (accepted answer, 3 votes): Say I have a schema like this: `` type Foo { required link bar -> Bar; } type Bar { required property baz -> bool; } How do I, knowing the id of a Foo object, update a property of a Baz object it points to? In other words, how do I update Foo.bar.baz value knowing Foo`'s ID?
Matched source
Source: Published skill Original query: "How to update a nested object in EdgeDB?" Key terms: edgedb, nested, object, update
Evidence
Source: Stack Overflow #74501898 (accepted answer, 3 votes): Say I have a schema like this: `` type Foo { required link bar -> Bar; } type Bar { required property baz -> bool; } How do I, knowing the id of a Foo object, update a property of a Baz object it points to? In other words, how do I update Foo.bar.baz value knowing Foo`'s ID?
Verified resolution: You can filter based on the backlink like this: `` select Bar filter .'df492862-80aa-11ed-832e-e72d12452736'; Where df492862-80aa-11ed-832e-e72d12452736 is the ID of your Foo object. That means you can update like this: update Bar filter .'df492862-80aa-11ed-832e-e72d12452736' set { baz := false };
Source URL: https://stackoverflow.com/questions/74501898/how-to-update-a-nested-object-in-edgedb
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_8gqDdyhJpnCwXRwgIwF6eQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">How to update a nested object in EdgeDB? <span>— Vectle</span></a>