-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added method to add multiple locations to GeoFire at once #56
Conversation
nice turn around time, let me know when this goes out and i'll fix transit |
@@ -428,6 +428,7 @@ function encodeGeoFireObject(location, geohash) { | |||
validateLocation(location); | |||
validateGeohash(geohash); | |||
return { | |||
".priority": geohash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this documented behavior? I couldn't find anything in the docs (but might have missed it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is documented for our REST API and I would not consider it a "hack" by any means. It is a part of our API, albeit not a very well documented one. I doubt we will add documentation around this since we plan to phase out priorities.
@jwngr lgtm except the two issues I mentioned. Also I would prefer overloading set, since that seems to be the standard js way of doing things, than adding a new method batchSet, but don't feel super strongly though |
Back to you @jdimond. |
Back to you once more @jdimond. Thanks for the code review! |
Added method to add multiple locations to GeoFire at once
@jdimond - Writing to GeoFire is making our transit Open Data Set practically unusable. We end up writing to the Firebase hundreds of times a second because we can only add one location to GeoFire at a time. This PR adds a new
batchSet()
method which allows you to add as many locations to GeoFire in only one write. I made it backwards compatible with the previous GeoFire version and data structure.This should significantly improve the performance of our Open Data Set and make it usable once again. Let's sync up on this tomorrow and talk about porting this to the other clients.
cc/ @tonymeng @vikrum