Back

how to store 2d arrays?

  • 0
  • Databases
  • Web
manazo
17 Apr, 2023, 08:55

as the title asks, how can I store 2d string arrays in the DB? appwrite only supports to store 1d array. I tried doing it. but it says Attribute has invalid types. Value must be a valid string

TL;DR
There currently isn't a built-in way to store 2D arrays in Appwrite. However, one potential solution is to use a Varchar attribute and manually parse the array yourself. This would involve converting the 2D array to a string and then storing it as a Varchar attribute.
Binyamin
17 Apr, 2023, 12:29

I don't think you can do such a thing with Appwrite

Eventually array it's just a syntactic sugar way that Appwrite manipulate text for you.

That's mean that if you want to have a complex array you can create Varchar attribute and parse it manually

joeyouss
17 Apr, 2023, 14:56
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more