TypeScript
$databases->updateDocument("[DB_ID]", "[COLLECTION_ID]", "[DOCUMENT_ID]", [
"[ATTRIBUTE]" => $var,
...
};
Here's the output of var_dump($var) directly before that call: array(1) { [1]=> string(20) "[VALUE]" }
Logs from the appwrite container:
TypeScript
Warning: Undefined array key 0 in /usr/src/code/vendor/utopia-php/database/src/Database/Validator/Query/Filter.php on line 194
Warning: Undefined array key 0 in /usr/src/code/vendor/utopia-php/database/src/Database/Validator/Query/Filter.php on line 194
[Error] Timestamp: 2024-11-19T18:59:45+00:00
[Error] Method: PATCH
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: Appwrite\Extend\Exception
[Error] Message: Invalid document structure: Attribute "[ATTRIBUTE]" must be an array
[Error] File: /usr/src/code/app/controllers/api/databases.php
[Error] Line: 3562
Failed to initialize logging provider: Unable to parse DSN: scheme is required
PHP8.3 Appwrite Self Hosted 1.6.0 PHP SDK 12.1.0
TL;DR
Issue with updating a document in the Appwrite self-hosted platform. The error message indicates that an attribute in the document must be an array, but it's not being recognized as such due to key starting from 1 instead of 0.
**Solution**: Ensure the array keys start from 0, not 1, when updating the document.Shouldn't it start with 0, not 1?
Recommended threads
- Which flutter SDK version for Self Hoste...
Hi all, Is there a good way to figure out which version of flutter SDK and Dart SDK is current for latest available self-hosted 1.8.0 ? I know new features are...
- Bug Report: Crash when trying to createR...
https://github.com/appwrite/sdk-for-android/issues/96 I think the bug is related with this one https://discord.com/channels/564160730845151244/1443887021314539...
- Dokploy docker compose
Hey guys hope y'all doing well, I was wondering if anyone could share a working 1.8.0 docker-compose that works with Dokploy I tried making it but it just does...