首页 > 解决方案 > 无法删除 Firebase 实时数据库中的值

问题描述

我想从我的实时数据库中删除一个节点(~13mb)。我使用 cli,firebase database:remove '/node'但我得到了An unexpcted error. 调试文件说:

[debug] [2020-09-30T10:17:16.845Z] TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined
at validateString (internal/validators.js:122:11)
at Url.parse (url.js:159:3)
at urlParse (url.js:154:13)
at Url.resolve (url.js:667:29)
at Object.urlResolve [as resolve] (url.js:663:40)
at Object.getDatabaseUrl (/usr/local/lib/node_modules/firebase-tools/lib/utils.js:62:26)
at Command.actionFn (/usr/local/lib/node_modules/firebase-tools/lib/commands/database-remove.js:33:32)
at Command.<anonymous> (/usr/local/lib/node_modules/firebase-tools/lib/command.js:166:25)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/lib/node_modules/firebase-tools/lib/command.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

当我这样做firebase database:get '/node'时,我得到了正确的值。

我已经更新了 firebase-tools 并做了一个新的初始化。

标签: firebasefirebase-realtime-databasefirebase-cli

解决方案


我今天遇到了类似的问题,并将其作为问题提交到 firebase-tools GitHub 上:

https://github.com/firebase/firebase-tools/issues/2667

我手动向数据库添加了一个微不足道的密钥,并firebase database:remove在尝试删除它时遇到了同样的问题。

希望那里的其他人可以重现并解决它。

(如果我有代表,我会对此发表评论......但也许看到问题在那里得到解决才是真正的答案)

编辑:通过数据库的变更日志解决:删除命令修复 #2658合并到主版本中并在 8.12.0 版中发布-效果很好


推荐阅读