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

173
Vistas
Firestore query the documents in subcollections using their IDs

I have a structure of nested subcollections and documents. Each name of the documents in the experience subcollection represents userId of some user that has experience in that game.

DB structure

I have a converted that attaches this userId to the document:

experienceEntity.userId = snapshot.id;
experienceEntity.experience = snapshot.data().experience;

I want to query documents from all the experience subcollections of all the games that have a certain userId. E.g. I want to get all documents having 400riCGTB0YkxAF52maPUr5jKPN2 ID from the screenshot above. I was trying this:

const result = await firestore()
  .collectionGroup("experience")
  .withConverter(gameExperienceEntityConverter)
  .where("userId", "==", userId)
  .get();

return result.docs.map((snap) => snap.data());

... but it returns an empty array. If I remove the where clause - it returns all the documents from all experience subcollections without any filtering (there can potentially be millions of those at this point).

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