简体   繁体   English

我可以将 firebase 数据库规则更新到我的机器中吗?

[英]Can I update the firebase database rules into my machine?

Is there a way to "deploy backwards", meaning updating the database rules file that I have on my machine with the changes that were already made online, using the firebase CLI?有没有一种方法可以“向后部署”,这意味着使用 firebase CLI 使用已经在线进行的更改更新我机器上的数据库规则文件?

I know it's possible to run firebase init database but it requires to confirm stuff twice (using /force didn't work).我知道可以运行firebase init database但它需要确认两次(使用/force无效)。

Is there a better way?有没有更好的办法?

Thanks!谢谢!

The Firebase CLI doesn't have a command to pull the rules of the Firebase Realtime Database as far as I know.据我所知,Firebase CLI 没有命令来提取 Firebase 实时数据库的规则。

You can get the rules via the REST API of the Realtime Database though, as shown in the documentation on Retrieving Firebase Realtime Database Rules via the REST API .不过,您可以通过实时数据库的 REST API 获取规则,如通过 REST API 检索 Firebase 实时数据库规则的文档中所示。 With CURL that's look like this: CURL 看起来像这样:

curl 'https://docs-examples.firebaseio.com/.settings/rules.json?access_token=<ACCESS_TOKEN>'

Alternatively, you can copy the riles from the Firebase console and then paste them into your local file.或者,您可以从Firebase 控制台复制规则,然后将它们粘贴到您的本地文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM