vortitriple.blogg.se

Stack 571 nutrition information
Stack 571 nutrition information










If you want to get the reservation only of a single type (manager or client), you should use a query that might look like this: db.collection("reservations").whereEqual("type", "manager") Īs you can see, I have also added a date property so you can easily sort them descending (last reservation first). You can also get all reservations by adding a reference on reservations collection. Find company research, competitor information, contact details & financial data for Stack 571 Burger & Whiskey Bar of Tacoma, WA. Using this schema, you can simply query the database to get all users or specific users (manager or clients). I'll try to provide you a schema that can help you get that data very easily. And each client should be able to see his history of reservations as well. The restaurant´s management should be able to see his reservation together with other reservations from other clients, in a list.

stack 571 nutrition information

You won't always want to query your reservations by restaurant, maybe you want to pull by user or time, etc. Instead of a collectionGroup query which would call for all restaurants' sub collection list of reservations. With this structure you can very easily just call:Īll reservations by user X or All foods meeting nutrition limits of Y You will find you'll want to store data multiple times and this to me feels like a good structure for it. This is good so if you request all reservations, you'll get the restaurant's name and ID, etc.

stack 571 nutrition information

What you'll notice is there is some redundant info. I think the optimal structure is: Restaurants (collection)

stack 571 nutrition information

It's a personal preference from working with a lot of nested collections. It's easy enough to take a restaurantID and stick it in the each document in those collections, so I don't personally think you should nest them in the Restaurants collection. I think storing Foods and Reservations as top level collections will ultimately yield you more flexibility later on.












Stack 571 nutrition information