Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

129
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda