Google Cloud Firestore console reading of all documents and charges

前端 未结 3 554
太阳男子
太阳男子 2021-01-13 16:19

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 co

3条回答
  •  既然无缘
    2021-01-13 16:48

    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

    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:

    For Android and iOS, offline persistence is enabled by default.

    For the web, offline persistence is disabled by default. To enable persistence, call the enablePersistence method.

    • For the web, offline persistence is an experimental feature that is supported only by the Chrome, Safari, and Firefox web browsers. Also, if a user opens multiple browser tabs that point to the same Cloud Firestore database, and offline persistence is enabled, Cloud Firestore will work correctly only in the first tab.

    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.

提交回复
热议问题