Maximum size of a document in firestore?

TccHtnn picture TccHtnn · Mar 7, 2018 · Viewed 17k times · Source

I want create a document that containing about 20 million objects.

The structure like that:

documentID
---- key1
-------- object1
-------------name: "test1"
-------------score: 123

I don't know the limitation of a document size in firestore, so can you help me any reference or information about that? Thanks!

Answer

Dan McGrath picture Dan McGrath · Mar 7, 2018

The maximum size is roughly 1 Megabyte, storing such a large number of objects (maps) inside of a single document is generally a bad design (and 20 million is beyond the size limit anyway).

You should reconsider why they need to be in a document, rather than each object being their own document.

Cloud Firestore's limits are listed in the documentation.