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

110
Visualizações
How to combine different paths in firestore version 9

I was using firestore version 8 and used the following code to create alternations in code:

const subQuestionRef = DB.collection('groups')
                         .doc(groupId)
                         .collection('questions')
                         .doc(questionId)
                         .collection('subQuestions')

if(someCondition) {
  subQuestionRef.doc(uid).set({somthing})
} else {
  subQuestionRef.doc(subQuestionId).set({somthingElse})
}

I couldn't find a way to create such alternations in firestore version 9.

Do you know how to create alternations in version 9?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

the way I would approach this with V9 will be the follow:

const subQuestionRef = collection(db, `groups/${groupId}/questions/${questionId}/subQuestions`)

if (someCondition) {
  setDoc( doc(subQuestionRef, uid), {something} )
} else {
  setDoc( doc(subQuestionRef, subQuestionId), {somethingElse} )
}

We now have a really nice API reference in V9.

doc() reference: https://firebase.google.com/docs/reference/js/firestore_.md#doc

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