Firestore constrains Documents to 1MB, including field names and document IDs.
Well, as far as I've tested, the generated IDs for created users and documents were about 50 Bytes long(I'm modeling the data in top level collections), but in the documentation apparently it could be as high as 1.5KB, which is a huge difference.
This directly impacts how I model the database, since I have an array of IDs inside a document and a counter. I have to know how many IDs to store.
Also, replacing the array by a collection with each ID as a single document inside is not a reasonable solution, it'd cost too much.
Can I assume that for a given collection, since my tests are all giving the same range of less than 50B for IDs,it won't suddenly create many IDs with 1.5KB ?
Without assuming that, the amount of IDs I can store in the array inside a document goes from around 20 thousand (if each ID has around 50B) to as little as 660 (if each ID has around 1.5KB).
Firebase does not offer a way to analyse how big a document is nor how many bytes an autogenerated document ID will have for a given collection.
I tested many different collections and have many users already. All of those autogenerated IDs where less than 50 Bytes long, so I'm assuming this is a pattern, but not convinced about it since there is no guarantee from the documentation.