Back

Issue with relations on database

  • 1
  • Databases
portmapping
15 Dec, 2024, 17:41

I'm creating a food ordering website for businesses.

I'm having issues with the relations on my database

I attached the attributes for the collections I'm having issues with. I've mostly worked with non relational databases like mongo but I believe I'm using the correct "standards" for this kind of database (correct me if I'm wrong)

APP CONTEXT/ BACKGROUND

  1. Each user can be either be a System Admin, Restaurant, Business, or Worker
  2. When I want to grab the Restaurant from a user I just get the logged user and travel through its contents made by the relations to get the Restaurant it owns and then get the orders of that restaurant. (Maybe this is a bad practice idk)
  3. When I try and display that info on the console I'm not getting the Restaurant the order belongs to and neither the Business that made the order, even though they are on my attributes and my schema

Attached the result of my console log at the end

TL;DR
Developers are debating whether to store only the Business and Restaurant names in the order for a food ordering website. They are facing issues with relations in the database. They included attributes for the collections but are struggling to fetch the desired information about the Restaurant and Business linked to the orders. A suggested solution could be to review the database schema and data retrieval methods to ensure proper association and retrieval of Restaurant and Business information.
portmapping
15 Dec, 2024, 17:45

Is it ok for me to just store the Business and Restaurant name in the order or is that bad in the long term?

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