RxFirebase按值搜索子级

时间:2019-03-12 11:41:08

标签: android firebase firebase-realtime-database

My JSON

我正在使用RxFirebase。如何通过值“名称”获取子级(例如5098)。

这是我的代码。

RxFirebaseDatabase.observeSingleValueEvent(
            remoteStObjectsDatabase.child("stobjekti").orderByChild("name").equalTo("TP-6220"),
            DataSnapshotMapper.listOf(StObject::class.java)
        )

data class StObject(
var address: String?,
var construction: String?,
var date_of_manufacture: String?,
var in_service_from: String?,
var name: String?,
var region_city: String?,
var technical_object: String,
var type: String?,
var x: String?,
var y: String?)

0 个答案:

没有答案