How do I export data from Firebase Realtime Database?

前端 未结 2 785
挽巷
挽巷 2020-11-29 07:15

I am developing with Firebase and have data stored in the Realtime Database. I need to share my database structure for a question here on Stack Overflow, or just take a back

2条回答
  •  渐次进展
    2020-11-29 07:25

    There is an Node.js tool called firebase-export, similar to firebase-import but not from Firebase itself, that will export JSON from the command line.

    Firebase export helper utility for exporting excluded JSON from Firebase.

    To install

    npm install -g firebase-export
    

    Usage example

    $ firebase-export --database_url https://test.firebaseio-demo.com --firebase_secret '1234' --exclude 'settings/*, users/*/settings'
    

    Github Repo


    Note: Firebase has a REST API, so you can use any language to retrieve (export) data:

    curl 'https://[PROJECT_ID].firebaseio.com/users/jack/name.json'
    

    Here's an example curl request with filters

    curl 'https://dinosaur-facts.firebaseio.com/dinosaurs.json?orderBy="height"&startAt=3&print=pretty'
    

提交回复
热议问题