问题描述
如果json树路径中的任何节点包含字符",则Firebase无法存储数据.即周期
Firebase is not able to store data if any of the node in the json tree path contain character "." i.e period
示例
https://.firebaseio.com/path/to/node/.json 将数据存储在上面指定的json树节点中.
https://.firebaseio.com/path/to/node/.jsonWill store the data in above specified json tree node.
但是,请在下面的查询中考虑我有."的地方.我的网址中的字符
However, consider below query where I have a "." character in my url
https://.firebaseio.com/path/to/node.speical/.json
它将返回
{
"error": "Invalid path: Invalid token in path"
}
这是因为Firebase服务器没有适当处理这种情况吗?请提出建议.
Is this something because firebase server have not handled this case appropriately??Please suggest.
推荐答案
是的,Firebase的键中存在一组不支持的特殊字符.从Firebase文档-
Yes, there are a set of special characters that Firebase does not support in it's keys. From Firebase doc -
如果密钥中存在这些字符,则需要对这些字符进行转义或编码.一个简单的字符替换编码也将起作用.
You need to escape or encode those characters if they are present in your key. A simple character substitution encoding will work too.
这篇关于具有字符“."的Firebase数据库REST API URL出现问题.即周期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!