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

183
Visualizações
Count the values present in a Realtime Database - Firebase

My goal is to be able to retrieve the total values present in a Realtime Database on Firebase via Javascript. I have everything set up and working perfectly, but not as well as fetching the total values present when I click a simple button.

This is an example of the values I would like to be able to take: enter image description here

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
        <button type="submit" id="searchData" class="btn btn-primary">Search data</button>
    </body>
</html>

<script type="module">
    import { initializeApp } from "https://www.gstatic.com/firebasejs/9.6.8/firebase-app.js";
    import { getDatabase, set, ref ,push, child, onValue} from "https://www.gstatic.com/firebasejs/9.6.8/firebase-database.js";

    const firebaseConfig = {
        apiKey: "********************************",
        authDomain: "********************************",
        databaseURL: "********************************",
        projectId: "********************************",
        storageBucket: "****************************",
        messagingSenderId: "******************",
        appId: "********************************"
    };

    const app = initializeApp(firebaseConfig);
    const db = getDatabase(app);


    searchData.addEventListener('click',(e) => {

    //

    });
</script>
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