feat(query): populate document reference or computed child key
See original GitHub issueWhat 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
NetSuite Applications Suite - Select Reference Types
Adding Items to Web Store Categories · Featuring Items · Customizing Items in Your Site ... Custom Child Record Sublist Creation with SuiteScript....
Read more >How can we use a computed property in the query key (e.g. ...
The react-query docs describe how to use a compound query key (Array Keys). I want to be able to do something similar with...
Read more >Chapter 5. Data Access and Change - HSQLDB
A SELECT statement featuring DISTINCT or GROUP BY or FETCH, LIMIT, OFFSET is not updatable. In an updatable query expression, ...
Read more >pugixml 1.13 manual
Document has one or more child nodes, which correspond to C++ type xml_node. ... Memory for XPath query objects as well as internal...
Read more >Apache Solr Reference Guide: For Solr 6.6
The main part of the reply is in the result tag, which contains one or more doc tags, each of which contains fields...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1
@devth That is a great idea! Thanks for sharing