【发布时间】:2020-06-02 18:01:06
【问题描述】:
我有如下数据样本
{
"random_key 1" : {
"id": 0,
"text": "This is text"
},
"random_key 2" : {
"id": 1,
"text": "This is text"
}
}
我想查询 'id' 等于 1 的节点。
val database = FirebaseDatabase.getInstance().getReference()
database.orderByChild("id").equalTo(1)
但此代码返回错误,因为通过此链接关注谷歌文档:https://firebase.google.com/docs/reference/android/com/google/firebase/database/Query
该库仅支持 Double、Boolean 和 String。我现在真的很困惑。怎么可能?
【问题讨论】:
-
错误信息是什么?
-
感谢您的回答。错误信息如下:
None of the following functions can be called with the arguments supplied: @NonNull public open fun equalTo(p0: Boolean): Query defined in com.google.firebase.database.Query @NonNull public open fun equalTo(p0: Double): Query defined in com.google.firebase.database.Query @NonNull public open fun equalTo(@Nullable p0: String?): Query defined in com.google.firebase.database.Query
标签: android firebase kotlin firebase-realtime-database