Did you make any changes to the collection or attributes after creating this relationship?
I may have deleted it and recreated (on an empty collection)
That could be the problem
Ideally this attribute should have been deleted too
Is there a work-around to delete the document - in this current state?
Is deleting the collection and recreating it from scratch the only solution?
What's the current value for the attribute?
I didn't get you. what do you mean by value
?
What's the result of getDocument?
empty list []
You might have to go directly into the database to delete it then
I'm not sure if this is an issue from the way I'm configuring or may be it should be documented as to how the relationships can be cleaned up. The other table gives this error:
[Error] Message: Unknown column 'object' in 'field list'
What I mean is - I'm not sure if I should be reporting this as a bug?
@Drake ^^
This issue persists even when both the collections are created from scratch and the relationships added.
what's yoour code and what are your collections (as JSON)?
Table 1
{
"$id": "654c9bc06a5b9d7a7c8d",
"name": "feed_activities",
"enabled": true,
"documentSecurity": false,
"attributes": [
{
"key": "name",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": false,
"size": 64,
"default": null
},
{
"key": "result",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": false,
"size": 524288,
"default": null
},
{
"key": "notify",
"type": "boolean",
"status": "available",
"error": "",
"required": false,
"array": false,
"default": null
},
{
"key": "actor",
"type": "relationship",
"status": "available",
"error": "",
"required": false,
"array": false,
"relatedCollection": "654c9aa06a5b9e7a7c8c",
"relationType": "manyToMany",
"twoWay": true,
"twoWayKey": "activities",
"onDelete": "setNull",
"side": "parent"
},
{
"key": "object",
"type": "relationship",
"status": "available",
"error": "",
"required": false,
"array": false,
"relatedCollection": "65570c6420b88746ea8d",
"relationType": "oneToMany",
"twoWay": true,
"twoWayKey": "activities",
"onDelete": "cascade",
"side": "child"
}
],
"indexes": []
}
Table 2
{
"$id": "65570c6420b88746ea8d",
"$permissions": [
"read(\"users\")"
],
"name": "feed_objects",
"enabled": true,
"documentSecurity": true,
"attributes": [
{
"key": "type",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": false,
"size": 16,
"default": "Object"
},
{
"key": "name",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": false,
"size": 32,
"default": null
},
{
"key": "actor",
"type": "relationship",
"status": "available",
"error": "",
"required": false,
"array": false,
"relatedCollection": "654c9aa06a5b9e7a7c8c",
"relationType": "oneToMany",
"twoWay": false,
"twoWayKey": "65570c6420b88746ea8d",
"onDelete": "setNull",
"side": "parent"
},
{
"key": "activities",
"type": "relationship",
"status": "available",
"error": "",
"required": false,
"array": false,
"relatedCollection": "654c9bc06a5b9d7a7c8d",
"relationType": "oneToMany",
"twoWay": true,
"twoWayKey": "object",
"onDelete": "cascade",
"side": "parent"
}
],
"indexes": [
]
}
I'm not using any code - just using appwrite web console to add/remove. Add works fine. But delete throws errors.
What are you doing exactly?
I have 2 tables that have this 2 way relationships - Object has activities and activity belongs to an object.
When I create an object, I also add zero or more activities. When I try to delete the obejct
it throws the error I have mentioned in the summary of this discussion.
I was able to successfully add and remove (link/unlink) documents as well as delete documents without any error 🧐
could the problem be with the 3rd relationship you have?
I'll try removing the 3rd relationship and check.
Recommended threads
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...