1

If I create a sub collection in certain document would this sub collection and its nested documents have the size limit of the parent document of that sub-collection? Or once a sub-collection gets created a new limit for its documents is available? In other words does firestore regard a sub collection as a part of a parent document regarding size?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Richardson
  • 1,804
  • 10
  • 38

1 Answers1

8

If you create a sub-collection under a document, that sub-collection doesn't count towards the 1 MiB limitation of the document. Besides that, all documents within that sub-collection have their own 1 MiB maximum limitation.

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
  • Is there any thing to know regarding nesting this way ? Performance wise ? – Richardson Apr 08 '22 at 12:13
  • 1
    No, [Firestore is as fast as it is at level 1 is also at level 100](https://stackoverflow.com/questions/68662007/what-are-the-benefits-of-using-a-root-collection-in-firestore-vs-a-subcollectio). So no worries. – Alex Mamo Apr 08 '22 at 13:00