I can't get this to work. Code is as follows and problem is res.data() doesn't show in de docs object.
getProjects = async () => {
const colRef = db.collection('parentCollection').orderBy('createdAt', 'desc');
const snapshots = await colRef.get();
const docs = snapshots.docs.map((doc) => ({
docId: doc.id,
...doc.data(),
...doc
.data()
.childId.get()
.then((res) => res.data()),
}));
this.setState({
list: docs,
});
};