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
- Account Status
Hello! I'm a student and am in the GitHub Student Organization, and according to GitHub, I am recieving pro membership via the Student Dev Pack. However, when I...
- Refund Request - Just purchased 2 mins a...
Hello Appwrite Team! I am a student and like 2 minutes ago I purchased Appwrite Pro ($15) because I had reached a limit on the number of attributes in a collect...
- Seed db
hello there... is this correct way to seed appwrite