Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

295
Vistas
how to filter in firebase using javascript?

below is my javascript code snippet, it responds showing all admin databases,taufik,nanarsih,,,I want to get the database value with admin key, how do I do that?

<script type="module">
// Import the functions you need from the SDKs you need
import {
    initializeApp
} from "https://www.gstatic.com/firebasejs/9.6.11/firebase-app.js";
import {
    getAnalytics
} from "https://www.gstatic.com/firebasejs/9.6.11/firebase-analytics.js";
import {
    getDatabase,
    ref,
    onValue,
    equalTo
} from "https://cdnjs.cloudflare.com/ajax/libs/firebase/9.6.11/firebase-database.min.js";

// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
    apiKey: "123",
    authDomain: "123",
    databaseURL: "123",
    projectId: "123",
    storageBucket: "123",
    messagingSenderId: "123",
    appId: "123",
    measurementId: "123"
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
const db = getDatabase(app);

onValue(ref(db), (snapshot) => {
    const data = snapshot.val();
    console.log(data);
});

In firebase

this is the response in the console log:

{admin: 123, nanarsih: 123, taufik: 123}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To just get the admin vaue from the database, you can create a reference to that path and then read that:

const adminRef = ref(db, 'admin');
onValue(adminRef, (snapshot) => {
    const data = snapshot.val();
    console.log(data);
});
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda