db.collection('RaidHistory').where({
RaidID:id
}).get({
}).then(res => {
console.log(res.data.length)
if (res.data.length == 0){
db.collection('RaidHistory').add({
data:{
RaidID:result[i].RaidID,
Brand:result[i].Brand,
Leader:result[i].Leader,
Time:result[i].Time,
AllMoney:result[i].AllMoney,
}
})
}
})
报错:reason: TypeError: Cannot read property 'RaidID' of undefined
是get打印还是add打印的?函数将RaidID作为变量了,明显不是get那边的问题,加引号试一试