Add Fourth Example to Update Docs
Opened this issue · 0 comments
The most common type of update, is to update an attribute owned by an object, and yet not know upfront whether that attribute is owned by another object. There fore the question is whether to delete just the relation, or the relation and the object.
The two examples in the update docs, are toys, and assume perfect knowledge, where this is usually not true. It is not always true that you can update an attribute and be sure you can also delete it.
Can you add the fourth example, of the typeql needed to test whether the attribute is owned by another object, and if so just delete the relation, and if not delete both the attribute and the relation? (i.e. need a not clause)
Finally, lets say that the property is named revoked, which is both boolean and optional, and the aim is to set it to True (i.e. revoke the object). But you are not sure whether:
-
- the property currently does not exist on the object
-
- the property currently exists on the object and its value is False
-
- the property currently exists on the object and its value is True (i.e previously revoked)
Can the update statement be used for all three of those situations, or only the first two? Can you provide a fifth example to handle those scenarios please? thanks