0

My firestore structure is like this:

Firestore structure

and I'm trying to make a query that returns just the documents inside fantasy-years (so just 2021, 2022) without returning any of the subcollections. But if I have a query like

return db.collection('fantasy-years').get()
    .then(result => result.docs)

then I get an empty array, but if I add another document without any subcollections, it will return that entry.

Is there a way I can get it to return those that do have subcollections (but not fetch the subcollection)?

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
  • The documents do not exist as mentioned in the linked answers (as their ID is shown in italics to indicate that). If you want fetch those docs in your code above, then add at least 1 field in those year documents to create them at first place . – Dharmaraj Sep 03 '22 at 13:21

0 Answers0