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
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- Increase by operators
I see appwrite have bunch of useful operators for querieng db. One more I would like to suggest is operators like increase the count of a int columns by 1,2.. ...
- createCollection Deprecated