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

143
Vistas
How can read data of other users (not user.uid) from firestore

I want to read the data of not authenticated users from firestore collection location is users->swipes->id enter image description here

my attemp not success


const querySnapshot = await getDocs(collection(db, "users",id,"swipes"));
querySnapshot.forEach((doc) => {
  // doc.data() is never undefined for query doc snapshots
  console.log(doc.id, " => ", doc.data());
});

I want to read id in swipes , not from user.uid here 3 users in users if want to read from user.uid , it is easy

collection(db, "users",user.id,"swipes")

if want to read from others users I confuse plz help

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

0

If you want to read the swiped subcollection from all users, you'll want to use a collection group query. This type of operation reads all collections with a specific name.

In your case that'd be:

const querySnapshot = await getDocs(collectionGroup(db, "swipes"));
querySnapshot.forEach((doc) => {
  console.log(doc.id, " => ", doc.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