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

87
Views
Attempting to use equalTo on Firebase Realtime Database query

I have the following node:

attendanceOptions: {
uid1: 'blah@example.com',
uid2: 'tap@example.com'
}

I'm trying to return only the key and value where value is equal to. These are my two attempts.

  const getMinistry = await admin.database().ref(`organization/${req.orgId}/attendanceOptions`)
  getMinistry
    .equalTo(req.memberUid)
    .once('value', snapshot => {
      functions.logger.log(snapshot.val())
    });

This returns null I also tried:

  const getMinistry = await admin.database().ref(`organization/${req.orgId}`)
  getMinistry
    .orderByChild('attendanceOptions')
    .equalTo(req.memberUid)
    .once('value', snapshot => {
      const data = snapshot.val();
      functions.logger.log( `this is data: ${data}` )
      return data;
    });

The log is this is data: null

In my rules I have:

"attendanceOptions": {
  ".indexOn": [".value"]
},

What am I doing wrong here?

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

0

The correct syntax is:

getMinistry
  .child('attendanceOptions')
  .orderByValue()
  .equalTo(req.memberUid)
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!