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!
If your app will be sending a stream of tiny updates, such as in a digital whiteboard app, we recommend Realtime Database. Hundreds of GBs to TBs of data that is read much more often than it is changed. For very large data sets, and when batch operations are frequently needed, we recommend Cloud Firestore.
There is no limitation on the number of documents in Firestore collection but it has a limitation of the size of the document. The maximum size of a document is roughly 1 MiB (1,048,576 bytes). Show activity on this post.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With