我的代码:
zengjiashuju : function() {
db.collection("aaaaa") //aaaaa是集合名字
.add({
data: {
name: "张三",
}
.then(res => { console.log(res);})
.catch(err => {console.log(err);})
})
},
错误信息:
将被索引
VM101 WAService.js:2 TypeError: {(intermediate value)}.then is not a function
at ge.zengjiashuju (index.js? [sm]:27)
at Object.n.safeCallback (VM101 WAService.js:2)
at VM101 WAService.js:2
at a (VM101 WAService.js:2)
at VM101 WAService.js:2
at n (VM101 WAService.js:2)
at VM101 WAService.js:2
at VM101 WAService.js:2
at i (VM9 asdebug.js:1)
at c (VM9 asdebug.js:1)(env: Windows,mp,1.05.2108130; lib: 2.14.1)