为什么这样工作
Query firstQuery1 = firebaseFirestore.collection("Test").whereEqualTo("test", "1");
这不起作用
Query firstQuery1 = firebaseFirestore.collection("Test");
firstQuery1.whereEqualTo("test", "1");
答案 0 :(得分:2)
firestore.collection("Test")
返回CollectionReference
类型的对象,而ref.whereEqualTo(..)
返回Query
所以而不是
Query firstQuery1 = firestore.collection("Test");
firstQuery1.whereEqualTo("test", "1");
它需要
CollectionReference ref = firestore.collection("Test");
Query query = ref.whereEqualTo("test","1");