Unable to fetch random data from Firestore! #6951
Unanswered
tusharkhatriofficial
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to fetch some data randomly from Firestore basically this case is little complex, I looked at the documentation too but am unable to find a solution. So the database contains a collection called userData and this collection store several documents which are the UID's of the users and finally each of these document contains a collection called craft and finally this craft collection contains details like name and other fields.
I tried to get a hold to this data as shown below:
Stream: FirebaseFirestore.instance.collection('userData').doc((FirebaseAuth.instance.currentUser!).uid).collection('craft').snapshots(),
and this way I was able to fetch data related to the user Id provided in .doc()
but now I want to display same data on another screen but don't want to fetch data related to a particular user so I am unable to figure out what to put into .doc() to fetch all the random records.
Stream: FirebaseFirestore.instance.collection('userData').doc().collection('craft').snapshots(),
Any kind of help is appreciable ! 😊
Beta Was this translation helpful? Give feedback.
All reactions