Skip to content
Advertisement

how can i get all the data in document firestore?

current i am working to my school project using android studio, it is an attendance system where I store my data to Firestore and the user are able to download/export the data to become Excel file. What I am trying to do is how can I get the all data in a single document of a Collection in firestore

here’s the code but it is only getting the first data in a document and it is showing in all the rows

JavaScript

Advertisement

Answer

You are looping over things multiple times where you probably don’t need to be. If you want to get multiple documents from a collection and have each document be a single row in the spreadsheet where the document fields fill the columns within that row, then you only need a single loop – over documents. It would look something like this:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement