Adding new document to database as array, saying must be string or below 100000 chars.
- 0
- Databases
- React Native
- Cloud
I am trying to add a new document to my database with an array.
When I try to create the document though, I get the error:
[AppwriteException: Invalid document structure: Attribute "info['1']" has invalid type. Value must be a valid string and no longer than 100000 chars]
While testing the recipeArray prints "["", [], " Minutes", 1, [{"amount": "5", "measurement": "g", "name": "shah"}], ["hello"]]" and is a valid array. Here is my functions code:
export async function createRecipe(title, recipeArray, creatorId, thumbnail = null) {
try {
console.log(recipeArray)
if (thumbnail) {
return await databases.createDocument(
appwriteConfig.databaseId,
appwriteConfig.recipeCollectionId,
ID.unique(),
{
title: title,
creator: creatorId,
info: recipeArray,
thumbnail: thumbnail
}
);
} else {
return await databases.createDocument(
appwriteConfig.databaseId,
appwriteConfig.recipeCollectionId,
ID.unique(),
{
title: title,
creator: creatorId,
info: recipeArray
}
);
}
} catch (error) {
console.log(error)
throw new Error(error);
}
}
Recommended threads
- How do I reference an Appwrite account i...
For Live Coding Alliance's website I would like to create multiple live coding profiles to switch between for each Appwrite account; clearly I can't make a rela...
- Realtime stopped working
Hey guys, I think my realtime functionality has stopped working over the past few weeks (and it had been working fine previously to that). I noticed another use...
- error my teammate is encountering
Unable to resolve "node-fetch-native-with-agent/agent" from "node_modules\node-appwrite\dist\client.mjs" this is an error that my teammate is encountering do...