Firebase数据库查询问题

问题描述

我有一个使用Python库Pyrebase设置的Firebase实时数据库。我正在尝试查询数据库以查找匹配的值。我的问题是我正在使用的查询不返回任何值,只是空括号。这是我用来检查匹配值func getTimeline(for configuration: SelectAccessoryIntent,in context: Context,completion: @escaping (Timeline<Entry>) -> ()) { // id stores the uuid of the accessory that was chosen by the user using the dynamic Intent if let id = configuration.accessory?.identifier { // Step 2.: fetch the accessory // hm is a HMHomeManager let hm = HomeStore.shared.homeManager // take a short nap until the connection to the local HomeKit instance is established (otherwise hm.homes will create an empty array on first call) sleep(1) let accessories = hm.homes.flatMap({ h in h.accessories }) if let a = accessories.filter({ a in a.uniqueIdentifier.uuidString == id }).first { // a holds our HMAccessory // Step 3.: select the characteristic I want // obvIoUsly the real code chooses a specific characteristic let s: HMService = a.services.first! let c: HMCharacteristic = s.characteristics.first! // Step 4.: read the characteristic's value c.readValue(completionHandler: {err in if let error = err { print(error) } else { print(c.value ?? "nil") } // complete with timeline completion(Timeline(entries: [RenderAccessoryEntry(date: Date(),configuration: configuration,value: c.value)],policy: .atEnd)) }) } } } } 查询。我似乎无法发现问题,我用readValue打印了整个数据库,它工作得很好。还要检查以确保传递了有趣的result = db.child("Users").order_by_child("Userid").equal_to( mUserID ).get()中的值,所以我不确定为什么只返回空括号,有什么想法吗?

下面是代码数据库截图以及规则。

db.child("Users").get()

enter image description here

getID()

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...