ios – How you can Add a Conditional whereField to a Firestore Question

I am querying Firestore collections utilizing .whereField. Relying on the consumer enter, it could be a single-condition or multiple-condition question. E.g.,

.whereField("shade", isEqualTo: selectedColorArgument)
.whereField("form", isEqualTo: selectedShapeArgument)

How can I code this question so {that a} situation is barely queried for when a price is chosen? E.g., if no “form” is chosen, then there shouldn’t be a .whereField("form", isEqualTo: selectedShapeArgument) situation thought of within the question. I used to be contemplating a swap assertion however there would too many circumstances with extra potential situations to pick.

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles