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

258
Vistas
Realtime Database Web: Is it possible to only get values?

I have a realtime db entries as shown below:

{
        <FIREBASE_GENERATED_KEY>:{username:<NAME>,message:<TEXT>,time:<TIMESTAMP>},
        <FIREBASE_GENERATED_KEY>:{username:<NAME>,message:<TEXT>,time:<TIMESTAMP>},
        ...
}

I am interested in getting only the values ordered by time in descending order and displaying them on UI. In Admin SDK I would do something like:

rdb
      .ref(`${rdb_paths.funfuse_connected_users}/${loc}`)
      .orderByValue('time')
      .get()

I see there's a method orderByValue but It doesn't take any arguments. How can we use orderByValue or anything to just get values instead of the entire object?

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

0

The Firebase Realtime Database always returns complete nodes from the JSON, or a set of complete child nodes that math a certain condition. There is no way to get a subset of the properties for each child node.

If you find yourself regularly needing only the time property of each child node, consider adding another branch to your database where you just keep the time values.

So:

"Original_data": {
        <FIREBASE_GENERATED_KEY>:{username:<NAME>,message:<TEXT>,time:<TIMESTAMP>},
        <FIREBASE_GENERATED_KEY>:{username:<NAME>,message:<TEXT>,time:<TIMESTAMP>},
        ...
},
"Times": {
        <FIREBASE_GENERATED_KEY>: <TIMESTAMP>,
        <FIREBASE_GENERATED_KEY>: <TIMESTAMP>,
        ...
}
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