Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

266
Visualizações
Firebase - How to query several keys/paths in one call?

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.

For example, I can do an update to several paths at once as follows:

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`] = "Magic.";
updates[`/slow/key/to/query`] = "Not magic.";
updates[`/fast/key/to/query`] = "Magical.";

rootdb.ref().update(updates)

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.

Example, using the update data from above, say I want the data at keys/paths:

`/fun/key/to/query`
`/account/${uid}/username`
`/account/${uid}/signupdate`
`/slow/key/to/query`

How can I get them all on one read call to Firebase Realtime Database?

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.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda