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
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...