Skip to content

Conversation

@obumnwabude
Copy link
Contributor

I had this error that doc does not exist on payload anytime I access DocumentData from snapshotChanges().
However, treating payload as DocumentSnapshot (using the data() method on it directly),
rather than treating it as DocumentChange, solved the problem.

So that's why I feel that the type of payload is DocumentSnapshot and not DocumentChange

Checklist

  • Issue number for this PR: #nnn (required)
  • Docs included?: (yes/no; required for all API/functional changes)
  • Test units included?: (yes/no; required)
  • In a clean directory, yarn install, yarn test run successfully? (yes/no; required)

Description

Code sample

I had this error that doc does not exist on payload anytime I access DocumentData from snapshotChanges().
However, treating payload as  DocumentSnapshot (using the data() method on it directly),
rather than treating it as DocumentChange, solved the problem.

So that's why I feel that the type of payload is DocumentSnapshot and not DocumentChange
Copy link
Member

@jamesdaniels jamesdaniels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@jamesdaniels jamesdaniels merged commit 05d6014 into angular:master Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants