javascript - firebase.firestore.FieldValue.arrayUnion 不是函数
问题描述
我正在尝试更新我的 Firestore 中的数组,我遵循了 Google 提供的文档(https://firebase.google.com/docs/firestore/manage-data/add-data)但它不起作用,我还检查以确保我拥有最新版本的 firebase npm 模块。
这是我的代码:
> db
.collection('Data')
.doc('One')
.collection('Doc')
.doc(this.$route.params.id.toLowerCase())
.update({
myArr: firebase.firestore.FieldValue.arrayUnion(
'test'
),
})
.then(() => console.log('Successfully written'))
.catch(err => console.log(err));
解决方案
Firebase npm 模块已过时。不得不手动重新安装
推荐阅读
- python - 使用 TensorFlow 进行预测缺失参数
- python - Groupby在python中使用循环
- git - 如何一般只获取当前分支
- php - Laravel 6 - 密码确认
- java - 自定义类型的 PCollection 汇总的管道性能 - 属性的平均值和中值
- html - 将HTML表单变量传递给Django中的python函数
- python - 如何从 django 上的 postgres 表和字段名称中删除双引号?
- xcode - 如何在构建机器上使用 Xcode 11 托管签名进行构建以进行分发
- c# - 如何将 SqlCommand 查询转换为使用使用连接字符串构建的参数,包括使用三元运算符的变量
- sql - 使用代码行运行 SAS 程序(在 SAS 项目内部)