in Education by
In Firestore documentation said: There are no additional costs for using cursors, page tokens, and limits. In fact, these features can help you save money by reading only the documents that you actually need. But the following queries produce 80 reads: val query = collection.orderBy("name") query.limit(30).get(Source.SERVER).continueWithTask { query.limit(20).get(Source.SERVER) }.continueWith { val doc = it.result!!.documents[5] query.startAfter(doc).limit(30).get(Source.SERVER) } I expect only 35 reads as second query start from the same point as first and reads only 20 documents which already read by first query. And third query start from the 5th document so it reads 5 new documents. Also if I run any of this queries multiple times reads count will increase as if I run it only one time. For example if i run first query 5 times reads count will increase only by 30 not 150 as expected by me. This queries differ only by limits which as said in documentation do not have additional costs for using. Why they produse additional reads(on usage tab at firebase console)? Maybe this reads won't be charged? Thanks! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
If I understand what you're describing correctly, this is intended behavior. I count 80 reads in your code, so I'd expect you to be billed for 80 reads. Note that .get triggers the reads immediately, regardless of whether you just retrieved the same documents a moment ago / a line above. val query = collection.orderBy("name") query.limit(30).get(Source.SERVER).continueWithTask { <----- 30 reads triggered here query.limit(20).get(Source.SERVER) <----- 20 reads triggered here }.continueWith { val doc = it.result!!.documents[5] query.startAfter(doc).limit(30).get(Source.SERVER) <----- 30 reads triggered here } and of course 30+20+30 = 80. And yes, limit is saving you money here, because without limit, then each of those .get()s would be reading ALL of the documents in the collection.

Related questions

0 votes
    In Firestore documentation said: There are no additional costs for using cursors, page tokens, and limits. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    Cloud Functions and Firebase Functions (or "Cloud Functions for Firebase") both look the same. Please describe the ... between these? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Google provides two cloud-based data storage services Google Cloud Datastore and Firebase (after its acquisition). ... vs Firebase? Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I has 1 issue with my project, i did subscribeToTopic(), has been successfully send 1 message to ' ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I'm working on an app that has video streaming functionality. I'm using a firebase database and firebase storage. ... end. Any advice? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I would like to know if Firebase Cloud Messaging is free or not for unlimited users? Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I have this operation EventModel data = EventModel(_nameEvent, _passEvent, _localEvent, _dateEventString); HashMap ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    I tried to find out how to use firestore local emulator for python and for testing purpose. But I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I'm currently using Cloud Firestore as my backend for a mobile app. I've got basic payments working ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 19, 2022 in Education by JackTerrance
0 votes
    Right now my firebase cloud firestore looks like this: const db = fire.firestore(); db.collection(" ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I'm querying a collection for a specific document and trying to get the document-ID from the result of ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    this is my first question here, i hope you can help me. I've been trying to get a specific path ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    this is my first question here, i hope you can help me. I've been trying to get a specific path ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    Ansible can deploy to virtualization and cloud environments, Including (i)Cloud Stack (ii)Google cloud platform (iii)All the Options (iv)Amazon web services (v)Open Stack...
asked Jan 25, 2023 in Technology by JackTerrance
0 votes
    The _______________ routes traffic between VMs and PaaS cloud services in a virtual network and computers at the other end of the ... DNS B. Server C. Load balancer D. VPN gateway...
asked Nov 20, 2022 in Education by JackTerrance
...