
I have a attribute items in my database and i want to store a list of Item objects which includes name, ID and price... I'm not able to figure out how do I achieve this with appwrite database

The best approach is to make a collection for those items

The database servers us in this way: Database > Collection > Document My database is 'orders' for storing all the all the orders, so each order will be a collection storing the necessary details, such as order ID, username, phone, address, items.. How can I create a collection inside a document?

In general, I recommend having a collection per object type. I would only create separate databases if there was some specific reason

You're telling me to create another collection for items, i got it.. But how I'll link it with the order of which the items( stored in the items collection)?

Have an order ID attribute in items

Hmm...Okay.. and while fetching the list of documents, I can filter it out by querying the Order ID... For that i need to add create index for the order id, right?

Got it, Thank you for the help 😊

[SOLVED] How do I store list of maps in appwrite database?
Recommended threads
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
