【发布时间】:2021-03-18 18:22:51
【问题描述】:
在我的颤振应用程序中,我需要更新我当前的用户数据,但我遇到了这个问题 [cloud_firestore/not-found] 找不到一些请求的文档。我该如何解决这个问题
这里是我的 updateData() 代码
void updateData() {
final FirebaseAuth auth = FirebaseAuth.instance;
final User user = auth.currentUser;
final uid = user.uid;
FirebaseFirestore.instance.
collection('users').
doc(uid).
update({"height": heightTextEditingController.text}).
catchError((e) {
print(e);
});
}
【问题讨论】:
-
文档不存在,添加你的数据库截图并打印(uid)看看你得到了什么
-
我添加截图
-
print(uid) 给你什么?
-
I/flutter (16766): KR8ScjsDfeZsFvjyK5qWkXSDsmI2 这个但是我没有这样的 uid
-
这就是为什么它不起作用
标签: android firebase flutter google-cloud-firestore