Complex searching and matching

Hi all,

I am having some issue understanding how to best retrieve specific data and I hope you can enlight me!

The DB is structured the following way:

  • Datatype “Restaurant” (field: name(text))
  • Datatype “Meal” (fields: name, barcode (text))
  • Datatype “CartItems” (fields: name (product), barcode(text))
  • Datatype “ProductRestaurantType” (fields: barcode(text), RestaurantName (restaurant), RestaurantPrice(number))

Essentially: each restaurant sell the same product but at a different price. I have chosen to setup a sort of jointtable (the Datatype “ProductRestaurantType”) cause the number of businesses could be in the thousands and the numer of products each business sell could be in the range of 50.000 products and cannot put them in a “list of” associated to each restaurant for performance issue and DB constrains. The insipiration came from this explaination Option 3 [Creating a Data Structure - Bubble Docs](https://manual.bubble.io/help-guides/structuring-an-application/data-structure)

Now the problem I am having are:

  • how can I show my users all businesses who sell ALL the products currently in Cart based on their barcodes?
  • How can I show my users how much they would pay for the items in cart, if they were to purchase from one or the other shops retrieved at the point above?

I am getting crazy with this for more than a week!

This topic was automatically closed after 70 days. New replies are no longer allowed.