I\'m trying to retrieve my documents with id but can\'t figure it out.
Currently I retrieve my documents like this :
const racesCollection: AngularFir
For document references, not collections, you need:
// when you know the 'id'
this.afs.doc(`items/${id}`)
.snapshotChanges().pipe(
map((doc: any) => {
const data = doc.payload.data();
const id = doc.payload.id;
return { id, ...data };
});
as .valueChanges({ idField: 'id'}); will not work here. I assume it was not implemented since generally you search for a document by the id...