work_detail 为集合名。
1、增
db.collection("work_detail").add({
data: {
detail_time: that.data.timeData,
}
}).then(res => {
console.log(res);
})
}).catch(err => {
console.log(err)
})
2、删
db.collection("work_detail").where({
type_num: deleteData.type_num,
}).remove().then(res => {
console.log(res);
}).catch(err => {
console.log(err)
})
3、改
db.collection("work_detail").doc("id数据").update({
data:{
detail_time: that.data.timeData,
}
}).then(res => {
console.log(res);
}).catch(err => {
console.log(err)
})
4、查
db.collection("work_detail").where({
type_num: 3,
month_data: that.data.consumeMonth,
year_data:that.data.consumeYear,
}).get().then(res => {
//成功
}).catch(err => {
console.log(err)
})