Export CSV from Firebase Firestore
Export CSV from Firebase Firestore
With Firefoo you can export collections to CSV with just a few clicks so that you can get your data into Airtable, Google Sheets or Excel.
Download and install Firefoo
If prompted, sign in with Google
Right-click the collection in the sidebar and select Export Collection
Make sure the CSV Format is selected and click the Export button
Select the file destination in the file chooser.
That’s it!
Select the Limit docs per Collection option to limit the total number of rows to export. If unselected, Firefoo is able to export millions of documents. Rows are not sorted by the date they were created or last modified. Instead, they are ordered by their document ID, which is usually random-generated. To export in another order, read on about how to export the result of a query.
You can export the results of a specific query with where and order-by clauses to CSV.
Click the collection in the sidebar on the left
Add Where conditions and Order by clauses. Adjust the number of documents with the Limit field, click the Run button to run your query!
Click the Export Results icon as seen in the screenshot below
If selected, Firefoo will add a column named __id__ to the exported CSV file, which contains the document ID. When documents of the collections do not have custom doc-IDs, this column will show the default auto-generated 20-character IDs of the document.
If selected, Firefoo will add a column named __path__ to the exported CSV file, which contains the full document path. Examples are
users/dan
orcities/Berlin/events/party123
.This option specifies how timestamps and numbers are formatted in your export. When unselected, timestamps are formatted in the ISO 8601 date format, e.g.2021-11-23T23:13:52.000Z. This should be your preferred option if you plan to import the CSV into another app or service, as it is widely supported.
If your Firestore documents contain Map fields (objects), Firefoo can either split them into multiple columns or serialize them to JSON.
Let’s say every document in a collection has an address field with two nested fields city and street, e.g.
Let’s say every document in a collection has an address field with two nested fields city and street, e.g.
address: { city: "San Francisco", street: "Market Street" }
- Split Maps into Columns: Firefoo will create two columns: address.city andaddress.street. This is more human-readable and should be preferred if the data is meant to be looked at by humans. Be aware though: if your data contains Maps with dynamic field names, the number of CSV columns can become very large!
- Export Maps as JSON: Serialize Map columns to JSON. In the example above, the exported value is
{city: "San Francisco", street: "Market Street" }
. This also works with nested Map fields. - As in Table View: This option is only available when exporting the results of a query! It will serialize Map fields to JSON, unless they were split into multiple columns in the Table view. Only the split-columns are exported as separate CSV columns, so that the resulting CSV table looks just like the Table view in Firefoo.
If you want to export a single subcollection to CSV, instead of one of the root-level collections, that’s also possible! Subcollections are not shown in the sidebar. That’s why you have to locate the subcollection in the Tree view (not the Table view) and open the right-click context menu from there. Choose Export and the same export dialog as above appears.
- String: The content of the string
- Boolean:
true
orfalse
- Null: null
- Map:
{"field1": "value1", "field2": 42, "field3": false}
- Array:
["hello", true, 42]
- Geopoint: Latitude and longitude are exported into two columns, e.g. a location field in Firestore will become
onelocation.__lat__
andonelocation.__lon__
column in the CSV file. - Timestamp: Defaults to ISO 8601 format:
2021-11-23T13:11:52.000Z
. Can be customized with️ ☑️ ️️️Custom Output Format option. - Document Reference: Full path to the document without leading slash, e.g.
myCollection/myDocId
ormyCollection/myDocId/mySubcollection/myNestedDocId
- Integer: Defaults to the full integer without any thousands delimiter, e.g.
12345678
. Can be customized with️ ☑️ ️️️Custom Output Format option. - Double: Defaults to the full unrounded double, without any thousands delimiter, e.g.
12345.987654
. Special valuesInfinity
,-Infinity
andNaN
are supported. Can be customized with️ ☑️ ️️️Custom Output Format option.
Firefoo uses one read request for every document that is exported into the CSV.
Right-click on the target database in the sidebar and select Import Collections. In the Import Dialog, choose the CSV file and specify the target collection name in the Target Path field.