0

I have a collection of bookings which contains "UserID", "restaurantID" & a "bookingID". I am storing it in a collection "Bookings". What I want here is show the collection "Bookings" in the field(bookings) of my "Users" collection and "restaurant" collection according to the userID & restaurantID.

**Restaurant and User Collection are pretty much the same.

Please help me with a solution to this. Thanks.

raj
  • 15
  • 2
  • Hello, what did you try? Can you share your code? – Renaud Tarnec Feb 25 '23 at 09:37
  • I actually don't understand how to do it.. I have just stored the data in firebase as a new collection. I want that collection to be used as a field in my restaurant and user collection. – raj Feb 25 '23 at 10:44
  • I believe you wanted to do join equivalent in firebase, you can store reference of another document in another collection in any collection instead of keeping copies of data. – Shanu Feb 25 '23 at 11:09
  • Have a look at [How do I join data from two Firestore collections in Flutter?](https://stackoverflow.com/questions/59061225/how-do-i-join-data-from-two-firestore-collections-in-flutter) – Frank van Puffelen Feb 25 '23 at 14:54

0 Answers0