聚合 更精细化的处理数据、求和、分组、指定字段
const collection = await db.collection(‘user’)
.aggregate()
.match({
字段:‘需匹配的字段名’
})
.addFields({
追加一个字段:true
})
.project({
排除掉的字段:false/0
})
.skip(要跳过n条数据)
.limit(限制输出n条数据)
.end()
watch监听变量的数据变化,类似computed,和data,methods同级
watch:{
item(newVal,oldVal){
console.log(newVal,oldVal)
}
}
数据懒加载,需要的时候才会加载
this.$set(this.dataList,current,data)