Git Product home page Git Product logo

Comments (8)

momoDragon avatar momoDragon commented on May 27, 2024 1

Do u think u can make a query that increases range automatically to get 1 doc? so like if radius is set to 10, it will query at 2km, 4km, 6km, 8km, 10km. And if at 2km there is an item, it will stop the query there. if there is none it will increase radius till 10. Because currently its impossible to use limit(1) because like the case i stated above, if there is an item at the corner of the geo hash box, but its not in the radius, it wont return anything because its in the box but out of radius.

from geoflutterfire.

DarshanGowda0 avatar DarshanGowda0 commented on May 27, 2024

Hey @momoDragon this library doesn't support limit() and sortBy(), in case you use limit() it'll run limit on all 9 queries individually. This was discussed on other threads as well. I'll keep the docs updated, sorry about that!

from geoflutterfire.

DarshanGowda0 avatar DarshanGowda0 commented on May 27, 2024

This should give you a better explanation.

from geoflutterfire.

momoDragon avatar momoDragon commented on May 27, 2024

Whats the best way to make a query like uber where we only get one document back in a 10km radius when there are multiple docs present ?

from geoflutterfire.

DarshanGowda0 avatar DarshanGowda0 commented on May 27, 2024

There's no way to set a hard limit in this library as explained in #21, the best alternative would be to set limit(1) on your query, which would read 1 doc from all geohashes, giving you 9 reads.

from geoflutterfire.

momoDragon avatar momoDragon commented on May 27, 2024

So even if i dont get anything back it will charge me 9 reads?

from geoflutterfire.

DarshanGowda0 avatar DarshanGowda0 commented on May 27, 2024

Hey @momoDragon! I believe yes, you'll be charged at least once per query even if you don't get back any results as mentioned in the cloud_firestore docs - https://firebase.google.com/docs/firestore/pricing#minimum-charge

from geoflutterfire.

DarshanGowda0 avatar DarshanGowda0 commented on May 27, 2024

@momoDragon to access the doc in the neighboring geohash box and not inside radius you can set the strictMode to false! And the requirement you stated can be done using RxDart operators on the application side itself.

from geoflutterfire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.