Open
Description
What is the feature?
My document looks like this
# /version/1/cookList/1
{
"name": "Foo",
"cook": "/version/1/cook/FJp534F4DegCxOW9y2Os"
}
I want to populate cook
whose value is full document path and not just ID. I tried something like this after going though few other issues but it did not work.
const populates = (dataKey, originalData) => {
if (originalData && originalData['cook'] && !originalData['cookData']) {
originalData['cookData'] = originalData.cook.split('/')[4];
}
return [{child: 'ownerData', root: 'version/1/cook'}]
};
const enhance = compose(
firestoreConnect([
{ collection: '/version/1/cookList', storeAs: 'cooklist', populates }
]),
connect(({ firestore }) => ({
cooklist: populate(firestore, 'cooklist', populates)
}))
);
What version would this apply to?
latest
Activity