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

181
Visualizações
List of users of chat room in firestore how to do that?

My webapp will have chat rooms, i need to implement list of users in that chat rooms.

  1. What is the best way to do that? By subcollection or array?

If array: How to update just one field in document? ( How to add user.uid to array )

If subcollection: How to get acces to subcolection in v9 firestore?

Code for creating room:

await addDoc(collection(db, "rooms"), {
            creator_uid: uid,
            name: _name,
            secured: is_secured,
            password: pass,
            room_members: [],
        });
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Based on the official documentation the best practice would be using subcollections will work better if you have simple, fixed lists of data that you want to keep within your documents, this is easy to set up and streamlines your data structure. Here is a great google documentation that could help you with the subcollection.

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