With the Upsert announcement, we are not having success with upsert in Swift. We’ve tried the following
(from the docs)
do { let doc = try await databases.upsertDocument( databaseId: databaseId, collectionId: collectionId, documentId: ID.unique(), data: ["title": "New Title", "author": "New Author"] ) } catch { print(error.localizedDescription) }
and also
let bookToUpsert = Book(id: docId, title: "New Title", author: "New Author")
do { let doc = try await databases.upsertDocument( databaseId: databaseId, collectionId: collectionId, documentId: docId, data: bookToUpsert, nestedType: Book.self ) print(doc) } catch { print(error.localizedDescription) }
We have verified read and write permissions are enabled (we can create, read, update and delete documents)
Swift, macOS 15.3, Apple SDK 10.1.1
the result is simply
Server Error
in the console, with no details
Perhaps we are doing something wrong in our code? Also, what's the situation with ID.unique() - if the id is always unique won't it always create a new document?
Recommended threads
- Permissions error
I try to create a row in my table but when i submit i have an error on my permission, i'm new on it so i dont understand the error. I have Row Security enable ...
- Console: Query on attribute has greater ...
I noticed an issue when one of my tables reached over ~800 rows. That table is relational to my users table Within the console I am able to view the table with ...
- Appwrite docs mcp server 502 bad gateway
I added the appwrite docs mcp server to vscode following the docs https://appwrite.io/docs/tooling/mcp/vscode#step-1 but upon start it gives the following error...