[SOLVED] Creating a new document with no required attributes fails "The document data is missing"
- 0
- Resolved
- 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
- Android SDK: Kotlin null Value Not Updat...
Hi team, I think you should check the Android SDK implementation once, as it seems to have an issue handling Kotlin **null** values. For example: When I send:...
- Can't connect GitHub — 500 error at the ...
Appwrite Cloud, Pro plan, SFO region. All my Git connections vanished today — Sites and all 15 Functions now show no repository connected. When I try to add a ...
- GB Hours IS NOT resetting
Hi, I was checking my usage and noticed that all of my usage quotas were reset on August 20, 2026, when my billing cycle renewed. Everything else appears to ha...