1

I want to give my users the functionality to find their friends through their contact list. Every user has his phonenumber in their document. My data structure looks like this:

user {
 username: 'abc',
 email : 'abc@abc.com'
 telephone: '+293184192123'
}

I know that there are many posts about the Logical OR, which are saying it doesnt work without an workaround, but I couldn't find a workaround in my specific situation.

And in the worst cast, is it ok to query maybe 100 queries one after another ? And is there something simular to BatchWrite for Read calls ?

EDIT: Here is an example how maybe a query would looked alike

db.collection("users").whereEqualTo("telephone", "+123456789")
                      .orEqualTo("telephone", "+777772423")
                      .orEqualTo("telephone", "+4923842959"); //And so on, you get the Idea

These telephone numbers will get readed out from the local storage from the Android Phone. So these phonenumbers are basically the contacts of the app user.

Ahmet K
  • 713
  • 18
  • 42
  • What's the query you intend to do that uses the Logical OR? – Rosário Pereira Fernandes Mar 03 '18 at 15:54
  • I updated my first post. Thank you for your help – Ahmet K Mar 03 '18 at 16:09
  • Firestore currently does not support an OR of values in a single field. See [here](https://stackoverflow.com/a/47019670/209103). You'll have to read then in separate queries, or (if possible) by doing a single range query as shown [here](https://stackoverflow.com/a/46726925/209103). – Frank van Puffelen Mar 03 '18 at 16:19
  • Thank you for your comment. Do you think that it is ok to make queries successively like in my amount ? I mean an averrage user would have min. 100 contacts. And how can I chain them together ? Is there a way like a BatchWrite ? – Ahmet K Mar 03 '18 at 16:25

0 Answers0