According to the CLI docs and its own help
command, I just need to pass it the path (which I assume is the path on the project), my json file, and any options. So this is what I do (while I'm in the folder containing the json data):
firebase database:set --project MyProject / myJsonData.json
where I want /
to be the root of my project, I want to wipe out existing data and replace it with the data in myJsonData.json
. However whenever I run this, even with changing parameter order, or putting the /
in quotes, it tells me Error: Path must begin with /
. The path is /
, so I don't know what it's complaining about. There's no examples of this command in use, so I don't know what it's expecting...
Firebase automatically creates your firebase. json file at the root of your project directory when you run the firebase init command.
Edit and update your rulesOpen the Firebase console and select your project. Then, select Realtime Database, Cloud Firestore or Storage from the product navigation, then click Rules to navigate to the Rules editor. Edit your rules directly in the editor.
The Firebase CLI is a utility used to administer Firebase projects and perform tasks such as Realtime Database management tasks from the command-line of a terminal or command-prompt window. The Firebase CLI is also the method by which Firebase Cloud Functions are deployed and managed.
Open VSCode, and then select File > Open (Open Folder on Windows) from the menu bar. Create the folder where you want your project to exist, and then open that folder. to ensure that node was installed correctly. and the package will install (you may need to run with sudo or as an Administrator on Windows).
Turns out the answer is to put //
as the path. Now I get an Unexpected error while setting data
, but that's another issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With