首页 > 解决方案 > firebase 数据库:从 CLI 更新 - 一个项目中的多个数据库

问题描述

我的 firebase 项目有多个实时数据库 (RTDB)。当我有多个数据库时,如何使用命令行界面 (CLI) 更新特定数据库?

$ firebase database:update --help

  Usage: database:update [options] <path> [infile]

  update some of the keys for the defined path in your Firebase

  Options:

    -d, --data <data>  specify escaped JSON directly
    -y, --confirm      pass this option to bypass confirmation prompt
    -h, --help         output usage information

我选择了我的项目,firebase use -add但帮助页面中没有任何关于定义数据库 URL 的内容,类似于这个问题。node.js firebase-import和 python firebase-streaming-import都包含数据库 URL 作为参数。

标签: firebasefirebase-realtime-databasefirebase-cli

解决方案


事实证明,今天在3.19.0 版本中发布了对此的支持。 firebase database:get --help现在报告:

--instance <instance>    use the database <instance>.firebaseio.com (if omitted, use default database instance)

因此,您应该能够使用它来指定数据库的速记实例名称。


推荐阅读