I’m not quite clear on what you’re doing here?
message: 'Invalid document structure: Unknown attribute: "$databaseId"'
Votes
0
Replies
24
Participants
Unknown
Messages
25
The database ID is the first parameter to the database.createDocument() or database.updateDocument() method
Rank 1: Thread
Rank 1: Thread
Rank 1: Thread
i have these that appwrite adds when getting the data
What is this?
Rank 1: Thread
data that im getting from appwrite
So where’s the error?
Rank 1: Thread
What’s the code that’s triggering that error?
Rank 1: Thread
this one
Wait, that error is coming back when calling databases.listDocuments()? Not when creating/updating a Document?
Rank 1: Thread
oh wait
Rank 1: Thread
sorry th
Rank 1: Thread
the first picture wasn't sent
Rank 1: Thread
mb
Rank 1: Thread
And what’s in newtag?
Rank 1: Thread
{
monday: 'm',
tuesday: 'azd',
wednesday: 'w',
thursday: 't',
friday: 'f',
saturday: 's',
sunday: 's',
user: '65e760c118cde1ce4ebf',
'$id': '661e594110cd04682356',
'$createdAt': '2024-04-16T10:56:01.071+00:00',
'$updatedAt': '2024-04-16T14:37:08.599+00:00',
'$permissions': [],
'$databaseId': '65ce3bba5179ce91f4ae',
'$collectionId': '65d5ded409a3fc3353db'
}
Ah - so there’s your issue - all the Attributes beginning with $ are system Attributes which can’t be set.
Rank 1: Thread
yess exactly
So you’ll need to remove them from newtag before passing it in to databases.updateDocument()
Rank 1: Thread
yes i did that but thought if it was system attributes why wouldn't the update ignore it in the first plcae then
Rank 1: Thread
thought i was doing something wrong
Yeah, I would expect it should, too.