title: Realtime database - orderByChild() works with once(), doesn't work with get()
body: <p>I have a database with following rules:</p>
  <pre><code>{
    &quot;rules&quot;: {
      &quot;users&quot;: {
        &quot;.read&quot;: &quot;auth.uid != null&quot;,
        &quot;.indexOn&quot;: [&quot;time&quot;, &quot;timestamp&quot;],
        &quot;$uid&quot;: {
          &quot;.write&quot;: &quot;$uid === auth.uid&quot;,
        }
      }
    }
  }
  </code></pre>
  <p>and data with format</p>
  <pre><code>users
    |_ uid
        |_ time
        |_ timestamp
  </code></pre>
  <p>When I perform a query (with Cloud Functions) using <code>once()</code> it works perfectly fine</p>
  <pre class="lang-js prettyprint-override"><code>await admin.database().ref(&quot;users&quot;).orderByChild(&quot;timestamp&quot;)
    .once(&quot;value&quot;, (snapshot) =&gt; {
      snapshot.forEach((childSnapshot) =&gt; {
        functions.logger.log(childSnapshot.key);
      });
    });
  </code></pre>
  <p>but when I perform query with <code>get()</code></p>
  <pre class="lang-js prettyprint-override"><code>await admin.database().ref(&quot;users&quot;).orderByChild(&quot;timestamp&quot;)
    .get()
    .then((snapshot) =&gt; {
      snapshot.forEach((childSnapshot) =&gt; {
        functions.logger.log(childSnapshot.key);
      });
    });
  </code></pre>
  <p>I get following error:</p>
  <blockquote>
  <p>Error: No index defined for timestamp at IndexMap.get</p>
  </blockquote>
  <p>Note that it's not the same error when index is not defined at all - in such situation error looks like this:</p>
  <blockquote>
  <p>Error: Index not defined, add &quot;.indexOn&quot;: &quot;timestamp&quot;, for path &quot;/users&quot;</p>
  </blockquote>
  <p>I was adding new entries after defining index, so all the data should be indexed (in theory). Of course I could just use <code>once()</code> but now I don't know whether my data is being actually indexed or not. Could anybody shed some light on this?</p>