Python (Pyrebase)错误:orderBy必须是有效的JSON编码路径
我使用firebase,我的JSON(firebase)如下所示。 我想使用busStopName值检索键值(288xxx) 我的代码如下。我将用“윤정사앞强>'Python (Pyrebase)错误:orderBy必须是有效的JSON编码路径,python,json,firebase,nosql,pyrebase,Python,Json,Firebase,Nosql,Pyrebase,我使用firebase,我的JSON(firebase)如下所示。 我想使用busStopName值检索键值(288xxx) 我的代码如下。我将用“윤정사앞' # Retriving id by using value def getIdByName(db, name) : bus = db.child("busStops").order_by_child("busStopName").equal_to(name).get() print
# 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, "윤정사앞")
我对这段代码的理想结果是28800001。
但也存在错误,即“错误请求””和“orderBy必须是有效的JSON编码路径””
请帮助我…您必须进入firebase中的规则,并更新您可以执行的规则。 在规则中,在firebase中,您需要更新以下内容:
{
"rules": {
".read": ...
".write": ...
"busStops": {
".indexOn": "busStopName"
}
}
}
我认为这是为了性能,不是必需的。问题可能是: