I'm working in angular with firebase and geoFire. I figured out how geoFire works but i still have these 2 questions about performance:
- In the geoQuery.on() callback, can i get 1 array with keys returned instead of 1 callback per 1 event.
- In the ref.once() callback, can i get all the tikis in 1 go instead of 1 by 1 using .child(key)?
My controller:
var ref = new Firebase("https://blistering-heat-1126.firebaseio.com/");
var geoFire = new GeoFire(ref.child("geoFire"));
var geoQuery = geoFire.query({
center: [50.315077, 3.13261],
radius: 100 //kilometers
})
geoQuery.on("key_entered", function(key, location, distance) {
ref.child("tikis").child(key).once("value", function(snap){
console.log(snap.val())
})
})
My firebase:
geoFire
-JmE05U-Wbr5LGRSh0Z8
-JmE0COUFBRPZIBqwfYN
tikis
-JmE05U-Wbr5LGRSh0Z8
-JmE0COUFBRPZIBqwfYN
-JmE0Iq7-uvrk5Tg_K8_
-JmE0MrnstNv9d_8ozQ4
thx for your insight...