Is there a way to automatically create a document if it doesn't exist, or update it if it does?
- 0
- Databases
- GraphQL
- General
- Web
Currently, I need to make two separate API calls: one to check if the document exists in the collection, and another to either create it if it doesn't exist or update it if it does. Is it possible to streamline this process so that a single API call can handle both scenarios: creating the document if it doesn't exist or updating it if it does?"
You're asking for an upsert API/method. We don't have that at the moment.
You could try creating an Appwrite function that wraps the logic
Duplicate question here as well: https://discord.com/channels/564160730845151244/1138110897013915709 in case itβs helpful
Might be something to explore. We had this question already multiple times iirc
Thanks for the confirmation. I will find the workaround. but reallly a needed inbuilt feaure. hope to see it in later release of appwrite.
feel free to create a feature request issue on github
Recommended threads
- Export, Import or Migration giving this ...
As you can see in yhe screenshot i am not able to export any data or export the data from tables. Also it is affecting the migration from appwrite to appwrite h...
- Project auto-blocked after load testing ...
Hi team π My project has been automatically blocked with the message: "Project is currently blocked β Access to this project is restricted. Contact support if...
- App build crashing with "Internal error"
Hello Appwrite team! π We are trying to deploy a Next.js application on Appwrite Cloud, but our builds are consistently failing. The deployment log successful...