I'm working on some project with AngularFire + FireStore.
My Firestore model looks like this:
Collection 1
- key1 {some data}
- key2 {some data}
Collection 2
- key1 {other data}
- key2 {other data}
Now I need to show list where I have some data from the first collection, and some data from another one. How to create such a list?
It seems to be pointless to make two observables and then merge it.
const collection = this.afStore.collection<any>(collectionName);
return collection.snapshotChanges()
.map(participants => {
return participants.map(participant => {
const data = participant.payload.doc.data();
const id = participant.payload.doc.id;
return {id, ...data};
});
});
I have this code that takes data + id, and now I need to use this id to pull data from another collection, but don't know how.