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

239
Vistas
How to limit query from the end. Firestore
const messagesRef = collection(db, 'messages')
const q = query(messagesRef, orderBy('createdAt', 'asc'), limit(25))

Im querying documents in 'messages' collection by creation time, the problem with this is that when im trying to limit documents, it limits from the start, but i want to limit it from the end. I want that user would see newer messages but not the old ones.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

To get the last 25 items, use limitToLast(25) instead of limit(25). While that function isn't mentioned in the guide on limiting data, you can find it in the reference documentation.

about 4 years ago · Santiago Trujillo 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