I am new to Firestore so I have a Profiles and Users collections. In the Cloud Firestore Console when I click on Database > Firestore > Data tab > Profiles or > Users the console is reading ALL the documents in each collection. These reads are counted in the Usage tab. So my question is if I have lets say 500K documents in the Profiles collection and clicked on Data I will be charged for reading 500K docs just to view the first 25 docs only. Just clicking on Data tab the console reads all the docs of the first Collection.
I tried using the filter but to use it you will have to click on the Collection and read all the docs first then you can edit the filter.
Is this the way it works or is it my misunderstanding?
Absolutely not! You are only charged with read operations for the documents that are apart of the query. I don't know the exact number at which the first query is limited but the data is loaded in smaller chunks, with other words a pagination system is implemented. So once you scroll down other elements are loaded and so on.
If you intend to create an app that uses Firestore as backend, please also note that, offline persistence:
This means, that once you get a document(s) from the Firebase servers, you are not charched anymore since the results are coming from the local cache.
I faced the same confusion a while ago and upon digging down to the issue I learnt that all the data which gets loaded in the 'Data' tab of Firestore page does count towards the overall Firestore usage.
However, I was concerned with the same question as yours thus I contacted Firebase support. They reverted back confirming the first instinct of mine(Document reads in 'Data' tab does count) BUT initially it reads only the first 300 documents of ANY selected collection, so even if your collection has over 1 million docs, it will still load only the first 300 documents.
They suggested a way around it until the Firebase team finds a legit solution
I just have a similar Question like and I find it redundant to post it as a Question so I'm posting it as asnswer,sorry for that,
Question:
so here I'm writing and reading the docId ,so will it affect the counts? I cannot have a check properly because with this many other operations are happening. Thanks .