title: Can I run a firestore query on a key that doesn't exist?
body: <p>Each user in my firestore database has a bunch of contacts. I show each user their contacts with the following query.</p>
  
  <pre><code>firebase
              .firestore()
              .collection('users')
              .doc(userId)
              .collection('contacts')
              .orderBy('lastContacted')
  </code></pre>
  
  <p>Now I want to introduce a new feature that lets people archive contacts.</p>
  
  <p>The simplest way to do this would be to add a "status" key to the contacts and set it to "active" or "archived".</p>
  
  <p>If I do this, is there any way to query for all the contacts that don't have the "status" key?</p>
  
  <p>I thought about assigning the status key a value of 1 or 0 instead. I thought this would let me try the following:</p>
  
  <pre><code>firebase
              .firestore()
              .collection('users')
              .doc(userId)
              .collection('contacts')
              .where("status", "&lt;", "1")
              .orderBy('lastContacted')
  </code></pre>
  
  <p>...but that does not work :(</p>
  
  <p>Can I run a firestore query on a key that doesn't exist?</p>
  
  <p>I want to return all contacts that don't yet have a status key.</p>
  
  <p>It's an existing database so I don't want to go back and add the status field to every single contact in the database. Is there any way to avoid doing this?</p>
  
  <p>I realise I can pull all contacts and handle the filtering on the client. I would prefer not to do this, this question is specific to fetching the data from firestore.</p>