-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Noob Question. object.valueChanges vs object.snapshotChanges #2106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You would use .snapshotChanges() whenever you want to get the metadata of a doc (e.g. DocumentID) and .valueChanges() when you need the data within the doc. You can't get document data from .snapshotChanges(). https://stackoverflow.com/questions/48608769/what-is-snapshotchanges-in-firestore |
Plus: The newest version of AngularFire allows you to use const tasks: Observable<Task[]> = this.firestore.collection<Task>('tasks').valueChanges({ idField: 'id' }); |
thaanks! @nickreynke where in the docs did you see that? |
@chrisjaimes it was implemented with this PR #1976 :) |
if I use snapshotChanges () is it counted as a call to the document? |
Hi. Sorry about this question but.
After read the docs, Someone could explain for dummies the difference between .valueChanges and .snapshotChanges()?
Thanks
The text was updated successfully, but these errors were encountered: