1

I have list of my contacts on the phone and list of all app users in Firestore. The users on Firestore have field with phone number. I wish to get from Firestore only the users that I have on the phone. My options:

  1. Get all users from Firestore and then do sync with local contacts. Do not wish to do so due to long sync and security threat.
  2. For each local contact chech if he exist in Firebase and then get it. Also long sync and many separate request.
  3. Write cloud function to do it.

My question is if I can avoid cloud function and send list of phone numbers (String) to Firestore and retrieve only documents with phone field that exist on the list?

Dim
  • 4,527
  • 15
  • 80
  • 139
  • What you're describing is called an "IN" query in Firestore, but you are limited to 10 elements to check in the query. https://firebase.google.com/docs/firestore/query-data/queries#in_not-in_and_array-contains-any – Doug Stevenson Nov 22 '22 at 19:46
  • So I need to do is pagination? Make multiple requests 10 elements each time? – Dim Nov 22 '22 at 20:02
  • Multiple requests. You might as well just query each phone number individually. It's effectively the same result. – Doug Stevenson Nov 22 '22 at 20:42

0 Answers0