【发布时间】:2022-01-21 21:51:55
【问题描述】:
我想更新字段文档的值。我写了一个查询,但它不起作用。
**//this query is working, I hava a doc Id**
final CollectionReference _company = FirebaseFirestore.instance
.collection('Company')
..where(FieldPath.documentId, isEqualTo: _auth.currentUser!.uid);
**// But this query is not working, because I have not doc** ID, its doc ID auto gen. ID in firebase
final CollectionReference _companyAdvert =
FirebaseFirestore.instance.collection('CompanyAdvert')..where('userId', isEqualTo: _auth.currentUser!.uid) ;
【问题讨论】:
-
你好 Zekai,你能改一下你的问题吗?目前还不是很清楚你需要什么
-
当然。首先感谢您的关心。
-
我正在开发一个基于 Firebase 的颤振项目。我创建了一个名为“Company”的集合并添加了一个字段 companyImage。公司集合的名称是用户 ID。其他集合名称是 CompanyAdvert。但是 CompanyAdvert 的文档名称是通过自动生成的 ID 创建的。如果公司想要更改其个人资料照片,则必须在 CompanyAdvert profileImage 字段中进行更新。我努力在我的代码中使用 _companyAdvert 变量。但我做不到。最后我该怎么做,对不起我的英语不好..
-
@ZekaiDemir 您可以编辑您的问题并重新调整它的阶段,不要发表评论。
标签: firebase flutter dart google-cloud-firestore