Closed jackphuongvu closed 3 years ago
My first guess is that the node you add is not added to the end of the list, so it doesn't match the .limitToLast(1)
condition in your query. GeoFire sets a .priority
value on each node, which affects how nodes are ordered. I'd highly recommend only accessing the geofire
node though the geofire-js API.
Given how long this issue has been open, I'm going to close it. If the problem is still relevant to you, please post a full MCVE with which we can reproduce the problem.
Version info
I think there is a problem with index rule of Firebase ref because it worked well with other reference however it just didn't work with this ref from
geoFirejs
Firebase:
3.6.9
GeoFire:4.1.2
Other (e.g. Node, browser, operating system) (if applicable):Test case
Steps to reproduce
This is my code inside componentDidMount from my React Native project
ref('geofire')
is the reference geofire in the local app as well This is my Firebase database.Expected behavior
onChildChange
should be called each time new item has been created on Firebase serverActual behavior
console.log
right now.