title: Firebase - How to query several keys/paths in one call?
body: <p>I know several keys whose values I want. I want to get them all in one firebase realtime database call. Performance is king. If I know what I want and where it is on the database I should not have to make several queries to get the data.</p>
  <p>For example, I can do an update to several paths at once as follows:</p>
  <pre><code>const updates = {};
  
  const usermeta = {
      username: username,
         email: user.email,
     lastlogin: unixEpoch,
    signupdate: unixEpoch,
          tier: tierChosen
  };
  
  updates[`/account/${uid}`] = usermeta;
  updates[`/users/${username}`] = 1;
  updates[`/fun/key/to/query`] = &quot;Magic.&quot;;
  updates[`/slow/key/to/query`] = &quot;Not magic.&quot;;
  updates[`/fast/key/to/query`] = &quot;Magical.&quot;;
  
  rootdb.ref().update(updates)
  </code></pre>
  <p>I know all my updates, make one call, done. Efficient, fast, low latency. How do I do the same on the read side? I don't want to listen to values. I want to retrieve them once. I know where they are, just get them all in one query.</p>
  <p>Example, using the update data from above, say I want the data at keys/paths:</p>
  <pre><code>`/fun/key/to/query`
  `/account/${uid}/username`
  `/account/${uid}/signupdate`
  `/slow/key/to/query`
  </code></pre>
  <p>How can I get them all on one read call to Firebase Realtime Database?</p>
  <p>In the search I did prior to posting I could not find an answer to this. Every solution was to use listeners or make several calls.</p>