I have an collection of objects inside the array like this.
example-
const [arrray, setarray] = useState<any[]>([
{
link: "",
title: "",
description: "",
tags: [],
images: null,
status: "pending",
category: "",
ownerId: "",
type: "Website Link",
},
{
link: "",
title: "",
description: "",
tags: [],
images: null,
status: "pending",
category: "",
ownerId: "",
type: "Website Link",
},
])
Is their any way that i can store this in appwrite database as it is. because user can add multiple objects up to 25 objects inside the array. after that what i want to do it is i wanted to show that data in card step by step as it is stored . I hope you understood so how i can implement this in appwrite . Or i have to store every object individually?.please help me with the approach.
Hey you could have an attribute which is a string and push the array as a string
And when you retrieve it from the db you could just parse the string
So while pushing the array , you should convert the array to a string by using json.stringify
and while retrieving you could use json.parse to convert the string back to an array
Hope this makes sense @LAKSHYA
BTW for your reference appwrite doesn't allow to store objects or arrays as it is
okay this makes sense 🤔. Let me try this approach.
thankyou
Sure, lemme know if it works
sure
Recommended threads
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...
- Database Write Limits hit
Hello Appwrite Admins, I'm a GitHub Education user, and about a week ago, my database was really badly optimized, resulting in about 600k writes in a single day...
- How to properly implement custom domain?...