prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 556 forks source link

Filter data specific to current user uid #868

Open viveshy opened 4 years ago

viveshy commented 4 years ago

I am using react-redux-firebase for my project. Data of various users are being stored in a collection quotes in Firebase as in the image at the bottom. Now, I want to filter the data from the collection quotes. I want to access data specific to current logged in user. BUT I'm unable to retrieve any data. P.S When I remove where: [["quote.authId",'==',props.auth.uid]], line from above code, (which should fetch all data ) data of all users are being fetched properly.Related images are : code-github database

prescottprue commented 4 years ago

Have you tried waiting for auth to load before creating the query? Otherwise the query will contain undefined - This practice is described in the queries section and in the auth recipes section of the docs