Firebase Cloud Firestore:无效的集合引用。集合引用必须具有奇数个段
2022-08-31 15:09:49
我有以下代码,但收到错误:
Invalid collection reference. Collection references must have an odd number of segments
代码:
private void setAdapter() {
FirebaseFirestore db = FirebaseFirestore.getInstance();
db.collection("app/users/" + uid + "/notifications").get().addOnCompleteListener(task -> {
if (task.isSuccessful()) {
for (DocumentSnapshot document : task.getResult()) {
Log.d("FragmentNotifications", document.getId() + " => " + document.getData());
}
} else {
Log.w("FragmentNotifications", "Error getting notifications.", task.getException());
}
});
}