正如你在下面看到的,我得到了自相矛盾的结果。所有的帮助都是感激的。
Firebase控制台查询
防火墙控制台查询结果
代码
db.collection("Jobs")
.whereEqualTo("stationA", "Clacton-on-Sea")
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
if (!task.getResult().isEmpty()) {
Log.d(tag, "Query snapshot not empty, size is " + task.getResult().size());
} else {
Log.d(tag, "Query snapshot empty");
}
} else {
Log.d(tag, "Error getting documents: ", task.getException());
}
}
});
代码日志
发布于 2020-01-31 11:08:44
我发现了这个日志,意识到我的手机被无线网络注销了。我通过登录wifi来修复它,但是我有一个强大的4g连接,在任何应用程序上都不起作用。我通过重新启动手机解决了4g问题。
W/Firestore: (21.3.1) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
发布于 2020-01-31 07:57:16
编辑,但保留下面供参考
在您的查询中,您正在查找"Clacton-on-sea“中的小写"s”,而您的数据库的大写为"S“。
这个代码告诉您如何使用根据Logcat中显示的错误创建一个修复索引。
如果您运行当前没有现有索引的查询,则将在Logcat中显示一个URL,您可以使用它生成新的索引。这通常需要在运行命令数据或组合各种操作符的查询时完成(例如。"==“和"<")。
https://stackoverflow.com/questions/60006519
复制