Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OR Logical operation in Firestore Query

Is there any way to apply OR operation in firestore queries like:

if (name == "Jhon" || lastname == "James") { then do this }

like image 628
Anoosh Khalid Avatar asked Nov 03 '17 09:11

Anoosh Khalid


1 Answers

It currently seems that Firestore does not support disjunctions.

Workaround would be to merge results of queries query.whereEqual(name, John) and query.whereEqual(surname, James).

Keep in mind, that from the result you have to delete the duplicated ones, those which are evaluated as true in both conditions.

like image 98
Adam Zvada Avatar answered Nov 13 '22 07:11

Adam Zvada