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

160
Views
Can we listen specific key value changes in firestore angular
getUserEventSummaryE(userId) {

return docData(doc(this.firestore, `/user/${userId}/event_summary/current/`), {idField : 'playing_summary'}).
  pipe(distinctUntilChanged((prev, curr) => _.isEqual(prev, curr)));

}

getUserEventSummaryE should only return document when playing_summary changes but current it returning document data when other than playing_summary key value changes.

Example Document data

{
id: 1,
playing_summary: 'playing',
userbalance: 222,
dob: '2021-05-02'
}

When I change Other than playing_summary then currently changes triggering.

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

0

You can't listen to any key-values in the documents, but you can do that on document. It's only triggered when a document is updated.

exports.dbEventsOnUpdate = functions.firestore
.document('events/{eventId}').onUpdate(async (change,context) => {
   
            const eventID = context.params.eventId;
            const newValue = change.after.data();
            const previousValue = change.before.data();
            const titleIsUpdated = newValue.title !== previousValue.title;
    })

You can check this link for more details.

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!