---
title: "Cloud Firestore now supports not equal queries"
description: "Cloud Firestore now supports not equal queries"
published: "2020-10-01"
last_updated: "2020-10-01"
authors:
  - "Todd Kerpelman (Developer Advocate)"
categories:
  - "Firestore"
  - "Launch"
canonical_url: "https://firebase.blog/posts/2020/09/cloud-firestore-not-equal-queries"
---

# Cloud Firestore now supports not equal queries 

*Published October 1, 2020 by Todd Kerpelman (Developer Advocate)*

---
Hi, Firebase developers!

In what might be my shortest (but most exciting) blog post this year, we wanted to let you know that Cloud Firestore now has support for not-equal queries. This means you can now query, for example, all documents in a "Projects" collection where the project's `status` field is not equal to the value `"completed"`

![cloud-firestore-1](https://firebasestorage.googleapis.com/v0/b/first-class-blog.appspot.com/o/blog-assets%2F2020%2F09%2Fcloud-firestore-not-equal-queries%2Foptimized%2Fcloud-firestore-1.jpg?alt=media)

On a similar note, Cloud Firestore also supports `not-in` queries, where you can query for documents where fields are not in a list of values. So you can, for example, find all documents in a "Projects" collection where the `status` isn't equal to `"completed"` or `"dropped"` with a single query.

![cloud-firebase-2](https://firebasestorage.googleapis.com/v0/b/first-class-blog.appspot.com/o/blog-assets%2F2020%2F09%2Fcloud-firestore-not-equal-queries%2Foptimized%2Fcloud-firebase-2.jpg?alt=media)

Note that neither of these calls will allow you to fetch documents where this field doesn't exist. If a field is completely missing from a document, it will not be returned in your query results.

![cloud-firebase-3](https://firebasestorage.googleapis.com/v0/b/first-class-blog.appspot.com/o/blog-assets%2F2020%2F09%2Fcloud-firestore-not-equal-queries%2Foptimized%2Fcloud-firebase-3.jpg?alt=media)

Notice that project 4593 does not get included in the results, because it has no owner field

When it comes to combining these not-equal operators with others in the same query, they have many of the same restrictions as other inequality operators (`<`, `>=`, etc.). You can't use a `!=` operator against two different fields, for instance. Similarly, you can't use a `!=` query on one field and then sort by a second field. And combining a `!=` query in one field with a `==` query in another field requires your creating a composite index. Make sure to check out the [official documentation](https://firebase.google.com/docs/firestore/query-data/queries) for all the details.

This functionality is currently supported by the iOS, Android and Web client libraries, as well as the Node.js and Java server-side SDKs. Support for C++ and other server libraries is coming soon.

We hope this new addition makes it a little easier to develop Cloud Firestore-powered applications, and as always, if you have questions, please feel free to reach out on [StackOverflow](https://stackoverflow.com/questions/tagged/google-cloud-firestore+firebase).

Happy coding!
