我正在对Firestore中的数据运行查询,但是我希望查询为空,但是Kotlin中的代码似乎正在输入!= null语句。
在链接https://ibb.co/N2nbX1s中,您可以看到Firestore并未提取数据,但确实输入了!= null。代码为什么要这样做?
我真的很困惑,因为在我的应用程序中的所有其他实例中,同一查询都能完美地工作。我的代码也在下面。
docref = FirebaseFirestore.getInstance().collection("winning_bid").document(dealid)
docref.get().addOnSuccessListener { value ->
if (value != null) {
new_lead.visibility = View.GONE
buyerbid_confirmlead.visibility = View.VISIBLE
buyerbid_selectleading.visibility = View.VISIBLE
Log.d("firestoreorigdeal",dealid)
Log.d("Firestoredeal","${value.data}")
Log.d("firestore2", "second check")
} else {
new_lead.visibility = View.VISIBLE
buyerbid_confirmlead.visibility = View.GONE
buyerbid_selectleading.visibility = View.GONE
Log.d("firestore3", "third check")
Log.d("Firestore_error", "No Data")
}
}