Comments (16)
I too would really like this feature, it's really inconvenient to make 100 extra requests to get the object data. I can see in chrome devtools that geofire is already pulling it down as well.
There were LOTS of requests on the geofire repo for this feature.
The best PR I could find was firebase/geofire-js#45
Would you be open to merging in a PR for this repo based off this?
from geofirestore-js.
@morrislaptop possibly, let me fix the tests and then see if it passes. If yes, then sure, but I'll have to get back to you on that by tomorrow night.
from geofirestore-js.
Hey @nicksav the way geofirestore works (as it is modeled as geofire), is that the library creates an index where you can query keys based off of lat/lngs. There are no at filters as we use geohashing to create a single string which we are able to query on. The geofire library does not allow for customized objects, and so for this library to replicate geofire for users of firestore, it does not support custom objects/fields.
I am open to changing this though, and have some thoughts on how I would like to handle this, but am not ready to make that big of a change atm.
from geofirestore-js.
@morrislaptop as long as it passes tests I'd say that I'm open. I mean it was something I was looking to do over the next week or two (wanted to have this up by the end of the month), however it'll require some planning on my end.
from geofirestore-js.
Just wanted to say that I was planning on working on a PR that fixes this tonight and @morrislaptop just beat me to it. Great job!
from geofirestore-js.
Hey guys while I appreciate the PR I think I'm going to be writing this myself. In my head I have a vision/ideas where I want this to go... And it will be a hard departure from how geofire
worked. But I think you guys will like it! I'll be pushing code tomorrow for y'all to peak into it. It should be good.
from geofirestore-js.
Aaand I realized it may be my fault the tests are failing, however there's still some big changes I want to make.
from geofirestore-js.
Could you merge in with a feature version and make your changes in a major version?
from geofirestore-js.
Because the tests are failing it's not going to auto deploy, I'll have to deploy version 1.1 sometime this week (be excited!)
from geofirestore-js.
Sweet! I think this will get a lot of users over from realtime / geofire over here!
from geofirestore-js.
Version 1.1.1
is up on NPM and should work! (Make sure you don't install 1.1.0
, it had a kinda major issue where it accidentally deleted the distribution code on postinstall
from geofirestore-js.
In 1.1.1 and 1.2.0 there was a setWithDocument() method, which I assume is what was being talked about here, right? But it got killed off in 2.0.0, was there any reason for it? It would solve the biggest problem I'm facing right now.
from geofirestore-js.
Hey @MvRemmerden, so v2.0.0 no longer needs a function to set with document because it only works with documents! It's no longer designed to be a secondary index for docs that we chained on that functionality to. Now when you add
or set
you pass in the document you want to store. The only requirement is that you have a Geopoint
on the doc as the coordinate
field (however you can call that something else if you look through the docs on the readme). Soooo you could do this.
geoFirestore.add({
name: 'A place',
details: {
good: 'stuff'
},
coordinates: new firebase.firestore.GeoPoint(37.79, -122.41)
});
from geofirestore-js.
That's amazing, had totally not seen that in the readme, thanks for clarifying!
from geofirestore-js.
I noticed that the above code makes it so the coordinates are stored both in the data as well as the coordinate attribute. Is there a way to add without making the coordinates be added to data as well aside from just deleting it immediately?
from geofirestore-js.
@Leuchapolo because we don't track the field you use to store the coordinates, we need to store it in order to do client side checks of the distance (to filter out places). Unfortunately it is needed.
from geofirestore-js.
Related Issues (20)
- Paginating data after fetched HOT 1
- Question - how can I find near documents with each unique radius? HOT 11
- How to write to firestore after geofirestore query HOT 1
- can't write to firestore properly after geofirestore query HOT 1
- StartAt or startAfter support HOT 1
- Query speed HOT 6
- Custom document key HOT 1
- Geoqueries with additional queries? HOT 3
- When querying `near`: `distance` prop is missing when distance is 0 HOT 1
- Support for Firebase JS SDK 9 HOT 9
- customKey not working on read HOT 10
- Pass a custom document ID HOT 1
- Query returning zero results when filtering with where HOT 8
- Support for new firestore 9.x? HOT 1
- runTransaction on a collection (server-side using cloud functions) HOT 1
- firebase geofirestore v9 not working HOT 1
- Bug double removed on a marker HOT 1
- Geofirestore and onSnapshot are giving delayed events - information is not updating properly
- Unsubscribe from GeoQuery.onSnapshot on document deletion HOT 1
- Typescript errors when trying to deploy function HOT 2
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 geofirestore-js.