Skip to content

Instantly share code, notes, and snippets.

@santospatrick
Created May 6, 2024 14:54
Show Gist options
  • Save santospatrick/f5fc021857c23675464f25be1f899e30 to your computer and use it in GitHub Desktop.
Save santospatrick/f5fc021857c23675464f25be1f899e30 to your computer and use it in GitHub Desktop.
Firebase export / import database indexes

this will select staging and export indexes

firebase use default
firebase firestore:indexes > firestore.indexes.json

then we need to import them in production, so we don't need to create all of them manually (could be 20+ and it takes some time)

firebase use production
firebase deploy --only firestore:indexes

Make sure firebase.json is pointing to the correct file firestore.indexes.json at field firestore.indexes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment