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

120
Views
Get the key of an object via Firebase v9 queries

Each Alphabet("A", "B", "C", "D") is an array of objects and each object having and id and name.

I want to write a function so that it returns me the key i.e ("A" || "B" || "C" || "D" || null) if an id already exists in any of the option. So my idea is that a user can only choose one option among(A,B,C,D). Can you suggest me any firebase query(JavaScript) for doing so.

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

0

There is no way to perform an OR type query like that across multiple fields in Firestore, not is there a way to have a condition on just part of an array element.

You will either have to perform a separate query for each field and merge the results in your code, or (and more likely) add an additional field to the documents with all the IDs from the all the other fields and then perform the query on that (merged) field.

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!