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

180
Views
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 answers
Answer question

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 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!