Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Firebase Realtime Database Property Listener

I have some data like so: leaderboards/board/{board id}/{child properties}

Screen capture of example data in Realtime Database

I have an added listener for boards, like so:

const boardRef = firebase.database().ref('leaderboards/board');
boardRef.on('child_added', (snapshot) => {
    // handle data
});

That part works fine. I then later want to listen to just a specific property on a board, to see if it changes. I do not want to listen to all child changes on the board, as a couple of the children can change really frequently and we don't want to be handling that much data except when needed (a certain app state). So, I tried this:

const endedRef = firebase.database().ref('leaderboards/board/123/ended');
endedRef.on('value', (snapshot) => {
    // handle data
});

However, when I update the 'ended' property in Firebase, the listener isn't called. It's only called when I first add the listener (so it appears to be hooked up properly) but then not when the property is changed. What's the proper way to solve this?

This post is similar, but as I'm already trying a 'value' listener on the property, seems to either not be a fix or not work for my data: How to listen to a specific value change in Firebase?

Thanks for any and all help!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This was related to something specific in my codebase, causing my listener removal to get triggered just after getting added. So if you're having a similar issue, check where you remove the listener!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!