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
- my database attribute stuck in processin...
when i created attributes in collection 3 of those attributes become "processing", and they are not updating, the worst thing is that i cant even delete them s...
- Is Quick Start for function creation wor...
I am trying to create a Node.js function using the Quick Start feature. It fails and tells me that it could not locate the package.json file. Isn't Quick Start ...
- Forever Processing Issue
I encountered an issue when creating attributes in the collections . if you create an attribute of type string for example and choose a size of 200 or 250 or a...
