我想通过在where子句中传递一些单词或文本来检索数据。但是问题 没有任何回应。谁能告诉我该如何查询?
当我传递州名的完整详细信息时,我就会获得价值。
val db = FirebaseFirestore.getInstance()
val statesRef = db.collection("states")
statesRef.whereEqualTo("name", "Maharashtra")
.get()
.addOnSuccessListener {results ->
for (result in results){
Log.e("Retrieved Data", "Retrieved data is ${result.id} and ${result.data}")
}
}
但是当我尝试这样的操作时,没有反应:
statesRef.whereEqualTo("name", "Mahara")
.get()
.addOnSuccessListener {results ->
for (result in results){
Log.e("Retrieved Data", "Retrieved data is ${result.id} and ${result.data}")
}
}