【发布时间】:2017-12-17 15:44:38
【问题描述】:
我正在尝试根据其 ID 更新 firebase 中的帖子。 所以我有一个变量存储在这样的地方
var postID = -xyz1234567;
firebase.database().ref('posts').child(postID).update({
blah: "blah",
foo: 'bar'
})
但我不断收到此错误消息;
错误:Firebase.child 失败:第一个参数是无效路径: “不明确的”。路径必须是非空字符串,并且不能包含“.”, “#”、“$”、“[”或“]”
【问题讨论】:
-
postID与您实际代码中的更新有关吗?看起来postID不在同一个范围内。 -
这看起来像一个语法错误
var postID = -xyz1234567;,而不是编写您认为postID的示例代码,而是发布minimal actual compiling code that reproduces the problem。
标签: javascript firebase firebase-realtime-database google-admin-sdk