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

163
Views
Firestore v9 update specific object inside an array

Hello guys I have a structure like this:

users {
  user {
    uid: "",
    apps: [
     {
      id: "",
      name: "",
      points: 0,
     },
     {
      id: "",
      name: "",
      points: 0,
     },
    ]
  }
}

I want to update for example points in the apps[0] array in firestore v9 how can I preform this I tried something like dot notation but it remove all other fields

    const db = getFirestore();
    const ref = doc(db, 'users', uid);
    const matches = await getDoc(ref);
    if (!matches.exists()) return;
    return updateDoc(ref, {
      "apps.0.points": 50
    });

also, I tried to remove the old one and add the updated one but I think this is not a good way to do this.

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

0

  const db = getFirestore();
        const ref = doc(db, 'users', uid);
        const matches = await getDoc(ref);
        if (!matches.exists()) return;
        const docData = matches.data()
        docData.apps[0].points = 50
        return updateDoc(ref, {
          ...docData
    });
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!