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

135
Vistas
Firestore not listing documents which doesn't have fields instead having sub collections

I am working on an attendance project. So, I have nested documents and collections. But problem is that:

Firestore not listing documents that don't have fields. Firebase db structure Pic it only listing documents that have fields.

I am doing this in JavaScript.

db.collection("Attendence").get().then((querySnapshot) => {
querySnapshot.forEach((doc) => {
    // doc.data() is never undefined for query doc snapshots
    console.log(doc.id, " => ", doc.data());
});

});


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

0

Firestore not listing documents that don't have fields.

That's the expected behavior. The documents that I see listed in italics ("CG1", "CSE A1", and "DG2") are not actually documents present in the collection.

The documents that are present in the "Attendence" collection and are writen in italics mean that there exist some subcollections with other documents added under those document IDs.

There is no query that can return those documents since they don't exist. So in other words, you have just reserved some IDs for some documents in that collection and then create a subcollection under it. These kinds of documents are visible in the Firebase Console because you might want to navigate into their subcollections.

One thing to remember, in Cloud Firestore documents and subcollections don't work like filesystem files and directories. If you create a subcollection under a document, it doesn't implicitly create any parent documents. Subcollections are not tied in any way to a parent document.

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