Closed codediodeio closed 3 years ago
A major pain point with angularfire continues to be mapping a document ID to a collection query. I propose we add an optional withId argument to collection.valueChanges(). This can be a simple non-breaking change and I can PR it.
withId
collection.valueChanges()
collection.valueChanges(withId?: string) // emits [ { myIdKey: 'MrfFpRBfWLTd7LqiTt9u', ...data }, ... ]
This will greatly simplify the code below
// current requirement ref.snapshotChanges() .pipe( map(actions => { return actions.map(a => { const data = a.payload.doc.data(); const id = a.payload.doc.id; return { myIdKey: id, ...data }; }); }) // after change ref.valueChanges('myIDKey')
Oh please yes!
Yes please.
That would be great.
This can be closed it was merged with #1976 (and thanks)
A major pain point with angularfire continues to be mapping a document ID to a collection query. I propose we add an optional
withId
argument tocollection.valueChanges()
. This can be a simple non-breaking change and I can PR it.This will greatly simplify the code below