Comments (8)
Hi,
The location based queries either by using GetDataInArea or by creating a location constraints and use get data are executed on the server with one small caveat. It's only possible to query for locations inside a square that encompasses a circle with the desired radius. Which means the server will return also entries that are in the corners of the square but outside the radius. That entries are then filtered out on the client side.
from firestore_helpers.
Okay so lets say that I have 100 documents and then with my given radius there are only 30 documents inside the square encompassing my radius, will Firestore only charge me for 30 document reads?
from firestore_helpers.
All I can say that its a serverbased query and that only that data should be transmitted. You have to check the payment details yourself
from firestore_helpers.
Thanks for the quick response it is very much appreciated. We are aware of the pricing details, we were just asking how your library filter the results. Is it whether your querying all the documents inside the collection and loops through those documents to perform the filters needed or do you implement some kind of geohashing to avoid querying all the documents within the collection.
from firestore_helpers.
I thought I already wrote that above. I query all documents in a given geografical rectangle based on an greater / less than query on geopoints on the server side.
from firestore_helpers.
What we mean is are you performing the query like this:
const businesses = await firebaseAdmin.firestore().collection("businesses").get()
// perform logic for nearby location
or like this
const businesses = await firebaseAdmin.firestore().collection("businesses")
.where("location", "==", geoLoc).get()
We just want to verify how are you fetching records from firestore because the first approach is pretty expensive in read operations.
Thanks in advance.
from firestore_helpers.
The second one which is meant if you say server side query. Also you can always look into the code
from firestore_helpers.
Great! Thanks for clearing that out. Cheers!
from firestore_helpers.
Related Issues (20)
- Can you add array_contains to server side query params list? HOT 7
- Can't apply clientSitefilters HOT 3
- Limiting query shows furthest document instead of closest HOT 2
- /example is broken. HOT 1
- Error: No named parameter with the name 'collection'. HOT 5
- getDataInArea(area: null, source: null, mapper: null, locationFieldNameInDB: null) HOT 1
- How to use this library in firebase cloud function HOT 1
- GeoPoint queries might be wrong HOT 8
- How do i get other data from the document after filter?
- error showing in after addin in depandacy HOT 3
- Update to work with cloud_firestore 0.12.9+
- This project vs geoflutterfire? HOT 1
- The library works with GeoHash ? HOT 2
- Is this library first loading all data before filtering? HOT 1
- V4.0.0 null safety
- Omitted properties in QueryConstraints HOT 2
- Multiple Constrains HOT 5
- getDataInArea returns nothing HOT 10
- radiusInKilometers 120.0km returns 400.0 km location HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firestore_helpers.