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

323
Vistas
react-native & firebase: request with a condition where in the mappage

Example of a json in my database

enter image description here

request

  firestore()
        .collection(COLLECTION)
        .where("types", ">=", 'lDQJJnsq2osTIWCPLMRg')
        .get()
        .then(querySnapshot => {
            const arr = []
            querySnapshot.forEach(documentSnapshot => {
                const data = documentSnapshot.data()
                const el = {id: documentSnapshot.id, ...data}
                arr.push(el)
            })
            resolve(arr)
        })
        .catch(err => {
            console.log('err ', err )
            reject()
        });
  1. Filer my collection if the property types containt a id specific I don't find how I add a condition 'where' in the mappage ('types') In my logic, If types containt my id ("lDQJJnsq2osTIWCPLMRg") return this object.

  2. Maybe for mobile, it's better to make a call with pagination, I found the method 'startAt' can help for pagination. It's correct ?

I begin with react-native & firebase, so thanks for help.

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

0

For paginating queries you need to use query cursors: https://firebase.google.com/docs/firestore/query-data/query-cursors

  1. use firestore.query to order your collection with orderBy
  2. use startAfter and limit to implement the pagination
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