'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
const collection = db.collection('unicloud-test')
const dbCmd = db.command
const docList = await collection.limit(1).get()
//console.log(event, docList);
if (!docList.data || docList.data.length === 0) {
return {
status: -1,
msg: '集合unicloud-test内没有数据'
}
}
let list = event.list
let res = await collection.where({
_id:dbCmd.in(list)
}).remove()
return res
};