Apple Developer
Hello. We are trying out Appwrite. We've gone through the getting started and setup guide and are attempting to create a document, copy/paste from the Getting started website here https://appwrite.io/docs/products/databases/quick-start except we've moved the createDocument to it's own function
func createDocument() async throws {
do {
let document = try await databases.createDocument(
databaseId: databaseId,
collectionId: collectionId,
documentId: ID.unique(),
data: ["title", "hamlet"]
)
print(document)
} catch {
print(error)
}
}
the My Books collection has an empty database with a single attribute "title" as String. When calling the function the return value is vague:
Invalid document structure: Unknown attribute: "0"
and the data is not written. Not sure where the "0" is generated from.
We think the api endpoint is correct "https://fra.cloud.appwrite.io/v1" however, the documentation does not match the website so we cannot verify.
One other note is that in the Quick Start guide, it says "You can skip optional steps." but it doesn't indicate which are optional, all of the steps following that statement? Perhaps some are required?