I am scratching my head around an apparently simple issue: searching if a set of things are available in a list of texts.
The real case scenario is that I want to display all stores that have a certain set of product in their stocks.
Products to search for get retrieved by the current user’s shopping cart and checked against each store’s stock that is a list of text.
I successfully managed to use this expression, but it only works when only one product is in the cart…
Hi there, @daviddavid… if I understand your post correctly, I believe you would need to use an advanced filter to do what you described. So, give this a shot… delete the constraint you are showing on the right and add the :filtered operator to the end of Search for Restaurants. Then, add a constraint to the filter that looks something like This Restaurant_Meals contains list Current User's WhateverMeals:each item's Title.
Oh, in case you don’t know already, one thing to keep in mind is that advanced filters happen on the client side, meaning the search is going to return all of the restaurants in the database to the browser and then filter them there. As you can imagine, that process could be a bit slow. So, anything you can do to limit the number of results in the search (for example, adding a constraint based on the user’s address) will help when it comes to how quickly the advanced filter is executed.
Hi Mike,
thanks a lot for the really complete response. Your solution solved my question!
At the same time you opened up an interesting topic and one more question came to my mind.
Since one product is sold my multiple sellers, I structured my data so that Restaurants have a list of products and Products have a list of restaurants data field…but how can I handle the different prices of each product? Each restaurant decides for a specific price point.
Related to performance, is there a limit to the number of elements storable in the DB? Consider I might have 200/300 thousands products as a whole, each sold at a different price points by each store.