How to export firestore sub-collection to bigquery table?

Viewed 1348

We need to export Firestore data to Bigquery for data studio reporting.

We are following the below process -

  1. We export the entire firestore database to google storage bucket
  2. Through scheduled job we export data from bucket to bigquery

Our Firestore has many subcollections and we are not able to export the subcollections.

Need expert advice - How can we export firestore sub-collection to bigquery table (Ideally different subcollection to different big query tables)

1 Answers

You can achieve this using a straight command as below -

  • gcloud beta firestore export gs://bucketName/folderName --collection-ids='subcollecName1' , 'subcollecName2'

Ensure that all your subcollections are uniquely named

Related