question: take result of first read and use it to fetch additional data
See original GitHub issueimport React from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { firestoreConnect } from 'react-redux-firebase';
{ ... }
const mapStateToProps = state => {
return {
transactions: state.firestore.ordered.transactions,
}
}
export default compose(
connect(mapStateToProps),
firestoreConnect([
{ collection: 'transactions', limit: 10, orderBy: ['createdAt', 'desc']}
]),
)(Listing);
What is the current behavior?
I store uid
s of users inside of each transaction document with the intention of building a nested document for each transaction containing the transaction information and user information in one object per transaction. Is this possible and if so what approach would you recommend? Usually, when using sagas I would just resolve the document first then make a second read for the particular user document. Unsure how to do this with firestoreConnect
though.
What is the expected behavior?
- Get 10 most recent transactions
- Each transaction contains a uid to a user in the /users/ collection
- For each transaction, take that uid and merge the relevant user document into the transaction object
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How To Use the JavaScript Fetch API to Get Data - DigitalOcean
In this tutorial, you will create both GET and POST requests using the Fetch API.
Read more >Fetch data in database always display first record
If the result of 'OleDbCommand.ExecuteReader' is multiple rows. You must call OleDbDataReader.Read() multiple. example: while (reader.
Read more >Using the Fetch API - MDN Web Docs
The simplest use of fetch() takes one argument — the path to the resource you ... with the result of parsing the response...
Read more >Python cursor's fetchall, fetchmany(), fetchone() to ... - PYnative
First understand what is the use of fetchall, fetchmany(), fetchone(). cursor.fetchall() fetches all the rows of a query result.
Read more >How to Use the JavaScript Fetch API to Get Data?
Approach: First make the necessary JavaScript file, HTML file and CSS file. Then store the API URL in a variable (here api_url). Define...
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
Population support was released as part of v0.6.0-alpha.3 (make sure to install from the
next
tag, notlatest
)Here are the docs: https://github.com/prescottprue/redux-firestore/tree/next#population. It is basically a direct port over from
react-redux-firebase
, so the populate docs for that may be helpfulSeems like you are looking for something like:
Let me know if it doesn’t work as expected and we can reopen
@prescottprue Works perfectly for me 😃