I'm trying to get all the documents that have my phone number as the fromNumber
or the toNumber
. My call right now is:
database.collection('documents').where('fromNumber','==',myPhoneNumber).get().then();
Instead of making 2 calls, one to check the fromNumber and the second one to check the toNumber, how can I check both at the same time and in the same .get()
?
Btw: tested this code:
database.collection('documents')
.where('fromNumber','==',myPhoneNumber)
.where('toNumber','==',myPhoneNumber).get()
.then();
But it checks if both are true, it's an AND
instead of the OR
I'm looking for.
According to the official documentation, there a are some query limitations, when it comes to Firestore:
As suggested in the documentation, you should create two separate queries and merge the result cliend side.