Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda