Home > Net >  Is firestore 1mb document size limit implemented in Firebase Emulator
Is firestore 1mb document size limit implemented in Firebase Emulator

Time:05-30

I have uploaded a huge data to Firestore emulator but I'm not getting any size limit error

How the document looks (Array length of 6) enter image description here

When I upload Array length of 120,000 the website gets hanged. But I have no problem retrieving it and displaying it in the console enter image description here

And according to the Storage size calculations, an integer is 8 bytes.. therefore my document is greater than 8 * 10 * 120000 = 9.6MB, But i have no problem uploading it and retrieving it.

Where have I done wrong?

CodePudding user response:

11111111 is a single number, not 10 numbers. 10 is the number of digits in that number, which doesn't really mean anything to Firestore, and is irrelevant to the way that numbers are stored in binary systems. It just must be within the upper and lower bounds of a 64 bit signed integer range.

It costs 8 bytes to store any number value. In the documentation it says that integers are 64 bit signed values. It might help to learn about how integers are coded in binary for the given maximum number of bits to use.

The calculation you're trying to perform is just 8 (bytes per number) * 120000 (numbers in the array). You should add some overhead (for example, the size of the id of the document and the name of the field), as described in the documentation.

If you think there is an error in the emulator, then you should file a bug there with your observations instead of posting to Stack Overflow.

  • Related