Fetch an object from Firebase RTDB.
To use fire
, create two environment variables with the following data:
- Set
FIRE_ACCOUNT
to the fully qualified path to a serviceAccount.json file - Set
FIRE_URL
to the database urlhttps://your-app.firebaseio.com
To fetch an object:
fire path/to/obj`
Flags
-a prepend path to key (used with [-k])
-k shallow, one key per line
-p pretty print
-s fetch shallow
- The sort order from
-k
is indeterminate (a feature of Go maps), but you could always pipe the results to sort:fire -k accounts | sort
.
If adding features or just playing around:
go run main.go -p path/to/some/object
Install to your GOPATH
go build -o ~/go/bin/fire main.go
Once installed, just run fire:
fire -p account/types
fire -s versions
fire -k some/deep/nested/object