0

I have two collections where one collection is referencing another. Below is my structure:

CURRENCY_PAIR

  1. CurrencyPair_Name
  2. CurrencyPair_id

CURRENCY_PAIR_LIMIT

  1. Limit_Currency_Pair_Id : CURRENCY_PAIR/0chTWgOpzolSxj590N1U <=makes a reference to the document in the CURRENCY_PAIR collection
  2. Limit_Buy_Price_Threshhold

How can i query both collections such that when i get a currency pair, it is equal to the Limit_Buy_Price_Threshhold field that was added to the db with.

user23424
  • 71
  • 2
  • 8

1 Answers1

1

As provided on this thread, Firestore does not have a concept of server-side JOIN which is very near to what you want to achieve when you mentioned that you wanted to query both collections.

What I could think of is that you could remodel your database in a way that you can perform collection group queries. It works by putting CURRENCY_PAIR_LIMIT as a subcollection to the document in CURRENCY_PAIR.

Donnald Cucharo
  • 3,866
  • 1
  • 10
  • 17