0

Following is the structure of my Firestore database.

Collection 'users' contain user information where the document name is same as the user ID. Every user will have Zip Codes. In the below screenshot user ID ending with 'O03' has three Zip Codes (123456, 369852, 478965)

enter image description here

Collection 'orders'. Whenever a customer places an order, it will contain the user's ID and ZIP Code.

enter image description here

There may be many orders which have the same ZIP Codes. What I want to do is, get the orders which contain ZIP Code that belong to the user, ZIP Code in the orders should match any three (in the given example) of the ZIP Code that the user has. Users can have many ZIP Codes and each user will have a different number of ZIP Codes.

Could someone help me with this?

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
Codist
  • 737
  • 8
  • 23

0 Answers0