Let's say I have 100,000 locations saved in the DB. And I make a radius query which returns 5 locations. Will I be charged for 100,000 document reads or 5? In the background do we download the unused results too?
Also while listening to a query result in real time, If a location changes which is out of bounds of my query, does that still count as a read?
This library is only for Realtime Database, not Cloud Firestore, so you're not charged per document read. You're charged for network traffic and storage.
GeoFire uses the Geohash system to index locations. So it's not possible for me to say exactly, but the answer is much closer to 5 than 100,000. We do as much server-side filtering as possible using the GeoHash and then do the final filtering on the client.
For real-time results the answer is the same. If something far away changes that won't affect your query. If something nearby changes it could fall within the geohash accuracy window even if it's not a true match.
Let's say I have 100,000 locations saved in the DB. And I make a radius query which returns 5 locations. Will I be charged for 100,000 document reads or 5? In the background do we download the unused results too?
Also while listening to a query result in real time, If a location changes which is out of bounds of my query, does that still count as a read?