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

107
Vistas
Query similar to a where clause in RD

I have the following structure in Realtime Database:

enter image description here

I've read a few questions on SO that it's possible and some say it's not possible so I'm a little confused on if this can be done or not but here goes.

I have multiple members (about 200) and I would like to return only those that are mStatus == true.

I attempted it by doing this:

const dbRef = ref(db, `organization/${org}/members`);
const queryConstraints = [orderByChild("mStatus"), equalTo("value")]
get(query(dbRef, ...queryConstraints)).then((snapshot) => {
  if(snapshot.exists()) {
    console.log(snapshot.val());
  } else {
    console.log('No data available');
  }
})

The return is null here is the security rule I use:

 "rules": {
    ".read": true,
    ".write": true,
      "members": {
        ".indexOn": ["mStatus"]
      }
  }

How would I run this query?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Since in the comments you said that your members list is under /organization/{uid}/, that is also where you have to define the index in your rules:

{
  "rules": {
    ...
    "organization": {
      "$uid": {
        "members": {
          ".indexOn": ["mStatus"]
        }
      }
    }
  }
}
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