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
- education plan not activated
Hi I have an edu id 13103046@iubat.edu but when I am trying to claim my plan and trying to logging with github where education student plan active. the appwrite...
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...
- 500 simultaneous OAuth logins from the s...
Hi, I'd like to ask about rate limiting around Google OAuth login on Appwrite Cloud. **OVERVIEW** Service type: A PWA (web app) for members of a university clu...