kum*_*ail 6 javascript firebase google-cloud-firestore
我正在尝试更新我的 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));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7866 次 |
| 最近记录: |