Dealing with multiple queries on the same route
See original GitHub issueI would like to make a couple of queries to the same path, but with different params. However, these queries are stored in the store based on ‘path’ param.
Example:
@firebaseConnect((props) => ([
{ path: 'goals', queryParams: [ `orderByChild=partner`, `equalTo=partnerId`] },
{ path: 'goals', queryParams: [ `orderByChild=expert`, `equalTo=expertId`] },
]))
@connect(({ firebase }, props) => ({
???
}))
Would it be possible to name a path for the queries to be stored at?
Example of the feature:
@firebaseConnect(() => ([
{ path: 'goals', storeAs: 'partnerGoals', queryParams: [ `orderByChild=partner`, `equalTo=partnerId`] },
{ path: 'goals', storeAs: 'expertGoals', queryParams: [ `orderByChild=expert`, `equalTo=expertId`] },
]))
@connect(({ firebase }) => ({
partnerGoals: helpers.dataToJS(firebase, 'partnerGoals'),
expertGoals: helpers.dataToJS(firebase, 'expertGoals'),
}))
I think this solution would also help with issue #55 whereas I could just store the data under different paths, so they would not be mixed and I would save some calls to the database.
Ideas?
Edit: Checked the source and I see you have dest
variable ( link ), but I couldn’t find how it’s used.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to handle multiple queries by same route? - Laracasts
I strongly advise against doing this though, consider just having different routes for each resource. Thanks, I created separate routes for each type....
Read more >Digging Deeper into Node.js: Accessing multiple queries ...
So I decided to access multiple queries within the same post request. To start, I created the Knex queries that would be sent...
Read more >Running two queries on the same table and implement them ...
1 Answer 1 ... You can only send the response ( res.render(...) ) once you have the result of both queries. Therefore you...
Read more >Quickly Change Multiple Queries, Same Source in Power Query
If you've created multiple queries from the same source and then the location of that source changes, you'd think that you would need...
Read more >Use a union query to combine multiple queries into a single ...
As you select fields, make sure that you add the same number of fields, in the same order, that you add to the...
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
Works like a charm!
There has been progress on this functionality. Hoping to get it into one of the upcoming release candidates so it can make it into v1.3.0.
Will post here when there is a published version.