Firstly, thanks for your work on this project! 🙂
I noticed that the populate function doesn't take into account if you want to just pick a childParam. I had to patch it to enable this behaviour and I think it may help others. Will you consider to merge a pull request with this change?
Here is the diff that solved my problem:
diff --git a/node_modules/react-redux-firebase/src/utils/populate.js b/node_modules/react-redux-firebase/src/utils/populate.js
index efce67f..669fc03 100644
--- a/node_modules/react-redux-firebase/src/utils/populate.js
+++ b/node_modules/react-redux-firebase/src/utils/populate.js
@@ -75,7 +75,7 @@ export function getPopulateChild(firebase, populate, id) {
return firebase
.database()
.ref()
- .child(`${populate.root}/${id}`)
+ .child(`${populate.root}/${id}${populate.childParam ? `/${populate.childParam}` : ''}` )
.once('value')
.then((snap) =>
// Return id if population value does not exist
Hi! 👋
Firstly, thanks for your work on this project! 🙂
I noticed that the populate function doesn't take into account if you want to just pick a childParam. I had to patch it to enable this behaviour and I think it may help others. Will you consider to merge a pull request with this change?
Here is the diff that solved my problem: