Hi. Sorry about this question but.
After read the docs, Someone could explain for dummies the difference between .valueChanges and .snapshotChanges()?
Thanks
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 valueChanges() in a way that it also maps the ID of the document to the document data that is being returned in addition to the document data itself.
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 https://github.com/angular/angularfire2/pull/1976 :)
Usar铆a .snapshotChanges () siempre que desee obtener los metadatos de un documento (por ejemplo, DocumentID) y .valueChanges () cuando necesite los datos dentro del documento. No puede obtener datos del documento de .snapshotChanges ().
https://stackoverflow.com/questions/48608769/what-is-snapshotchanges-in-firestore
if I use snapshotChanges () is it counted as a call to the document?
Most helpful comment
Plus: The newest version of AngularFire allows you to use
valueChanges()in a way that it also maps the ID of the document to the document data that is being returned in addition to the document data itself.