问题描述
需要一些帮助。我无法从 arrayUnion
访问 FieldValue
或 firebase.firestore
。我在firestore上存储了一系列地图。即使 {merge:true}
不起作用,我也需要在同一个数组中附加数据并增加索引。我正在使用 Ionic 3。
firebase.firestore.FieldValue.arrayUnion
- 在 arrayUnion 处出错。
错误是:
Property 'arrayUnion' does not exist on type 'typeof FieldValue'
解决方法
万一有人遇到同样的问题。 arrayUnion 方法在 firebase v5.3.0 及更高版本中。 它还包含了这么多的数组操作方法。只需通过 npm firebase@latest
更新 firebase