Hello, I am trying out the new bulk operations feature, and I am experiencing some problem:
I am trying to call database.updatedocuments, and I am passing in the data you can see in the attached screenshot, but I get this error
❌ Server-side rule application failed after 81076ms: AppwriteException: Invalid document structure: Missing required attribute "user_id" at async POST (src/app/api/apply-rules/route.ts:384:19) 382 | 383 | // Wait for batch to complete
384 | const result = await userClient | ^ 385 | .generateServerClient() 386 | .updgradeToAdmin() 387 | .databases.upsertDocuments( { code: 400, type: 'document_invalid_structure', response: '{"message":"Invalid document structure: Missing required attribute "user_id"","code":400,"type":"document_invalid_structure","version":"1.7.4"}' }
but as you can see I have that field filled.
I have tried with bot updateDocuments and upsertDocuments, but the problem is the same. Moveover, in the documentation I see that the payload to send to updateDocuments should be this:
const result = await databases.updateDocuments( '<DATABASE_ID>', '[COLLECTION_ID]', { { documentId: 'document-id-1', data: { name: 'Updated Document 1' } }, { documentId: 'document-id-2', data: { name: 'Updated Document 2' } } } );
Which I think is wrong because it is not a valid javascript object. So I made it an array with those object, but the problem is still there
Recommended threads
- TablesDB `updateRows` returns `database_...
Hi Appwrite team! I’m seeing a strange issue with TablesDB bulk row updates on a self-hosted Appwrite instance. **Environment** - Appwrite self-hosted `1.9.0` ...
- Update row sheet not loading
After right clicking a row header and click update, the sidebar fails to load (never-ending skeleton)
- DB Relational Table Request
Hi, I'd like to suggest a rewording of the relationships between tables. - Current wording: storeOperatingDays can contain one storeId ...