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
- Sudden CORS Errors - Domain hasn't Chang...
I have an Appwrite project with two web apps configured, the first one has the hostname `*` and the second one I just added to test if it could fix the issue wi...
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- Collections list not showing up when try...
I'm trying to create new relationship attribute but both one way and two way relationship is not showing up collections list to connect with my relationship att...