[SOLVED] Creating a new document with no required attributes fails "The document data is missing"
- 0
- React Native
- Cloud
Hi! So I'm trying to generate a new document through a api call and get the error "The document data is missing" when my collection does not required any of the attributes to generate a new one. My method is
export const createEmptyCarSetup = async () => { try { const newEmptyCarSetup = await databases.createDocument( databaseId, carSetupCollectionId, ID.unique(), {} ) return newEmptyCarSetup } catch (error) { throw new Error(error) } }
Am I missing something or is this not the way the wiki mentions how to create default documents? https://appwrite.io/docs/references/cloud/server-nodejs/databases
An empty document?
Yes
Yes
By empty I mean all the attributes will be set to the default value
What if you pass "undefined" for each attribute?
You really shouldn't try and hijack another support post
Yeah so it works if i define every single attribute in the request but that just seems wrong for soemthing that requires no data to be set for any of the attributes
yeah that took me by surprise lol
If you just pass undefined for the data what happens? But I agree, it should work with no data if nothing is required, you can create an issue in the repo.
The problem seems to occur here... https://github.com/appwrite/appwrite/blob/main/app/controllers/api/databases.php#L2818-L2820
Nice! Yeah I'll create a new issue!
[SOLVED] Creating a new document with no required attributes fails "The document data is missing"
Recommended threads
- 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...
- Appwrite Storage error 503s for automate...
I'm facing error 503s from Appwrite after about 5-6 seconds of making AI requests from my tool with images and files above 20MB (=> not inline base64 used, but ...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...