繁体   English   中英

Angularfire 更新集合中的特定字段

[英]Angularfire update a specific field in a collection

我正在尝试使用 Angularfire 在集合深处找到一个特定的字段值(一个唯一的 id),然后更新该集合中的其他字段。 该图像是数据结构。 看不到的是classSchedule[0]/uniqueId中的另一个字段。

我想要做的是使用该 uniqueId 字段获取对 classSchedule[0] 的引用,然后更新 classSchedule[0] 的长度字段

我似乎无法访问该集合。 我试过了:

让 id = this.authService.currentUser.uid const docRef = this.firestore.collection( profile/${id}/classSchedule , ref => ref.where("uniqueId", "==", uniqueId));

和:

this.firestore.collection( profile/${id}/classSchedule/${index} )

但我不断收到此错误:

“AngularFirestoreCollection”类型上不存在属性“更新”

当我尝试对这些文档引用进行 .update 时。

结构

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM