3

I'm trying to use the firebase cli to upload data to the firebase real-time database. I followed the examples on the firebase blog, but I'm running into a problem.

It seems that the Windows version of the firebase cli doesn't allow for data from STDIN or as an command line argument, which contradicts the firebase documentation for the cli.

I'd like to avoid writing the JSON to a file just for the upload. Is it possible to use the firebase cli in Windows to update the database without using a file?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
B. Yoder
  • 33
  • 2

1 Answers1

1

When I run the following command in the Windows command shell:

echo {'foo':'bar'} | firebase database:set -y /foo

It responds with the following message:

Error: STDIN input is not available on Windows.

However, this sort of command works fine on Macos and Linux (I wrote that blog, and I took care to actually run the commands I talked about!). The documentation is technically correct for those two platforms. It just doesn't document the fact that STDIN doesn't work on Windows (my guess is that node.js doesn't handle this).

I'll file a bug internally to get the documentation updated to reflect reality on Windows.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441