我使用 firebase,我的 JSON(Firebase) 如下。
我想使用 检索键值( 288xxx ) busStopName 值。
我的代码如下。我将用' 做一个例子윤정사앞 '
# Retriving id by using value
def getIdByName(db, name) :
bus = db.child("busStops").order_by_child("busStopName").equal_to(name).get()
print(bus.key())
...
...
getIdByName(db, "윤정사앞")
我对这段代码的理想结果是 288000001 .但是有错误,它们是' 错误请求 ' 和 ' orderBy 必须是有效的 JSON 编码路径 '。
请帮我...
最佳答案
你必须进入 firebase 中的规则,并更新你可以做到的规则。
在规则中,在 firebase 中,您需要更新:
{
"rules": {
".read": ...
".write": ...
"busStops": {
".indexOn": "busStopName"
}
}
}
关于python - (Pyrebase) 错误 : orderBy must be a valid JSON encoded path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57267066/