How to create a logical OR query in Cloud Firestore with the JavaScript SDK?

Renaud Tarnec
Nov 7 · 2 min read

With Cloud Firestore, we can combine multiple where() methods to create logical AND queries. These queries are called compound queries in the documentation.

However, as indicated in the documentation (Section “Query Limitations”):

Cloud Firestore does not support the following types of queries:
- …
- Logical OR queries. In this case, you should create a separate query for each OR condition and merge the query results in your app.
- …

Keep the story going. Sign up for an extra free read.

You've completed your member preview for this month, but when you sign up for a free Medium account, you get one more story.
Already have an account?

Renaud Tarnec

Written by

Full-Stack Web Application Dev & PM // Firebase lover and advocate // Vue.js, SPA and PWA aficionado

Firebase Tips & Tricks

A collection of articles, recipes and tips & tricks on how to develop with Firebase, by a group of Firebase developers active on Stack Overflow

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade