// 雲函數入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
const dbList = db.collection('playlist')
// 雲函數入口函數
exports.main = async(event, context) => {
//skip 表示從哪裏開始取
// limit 表示要取的數量
// orderBy 表示排序 (排序的字段,排序的方式)
// where 查詢條件
return await dbList.skip(event.start).limit(event.count).orderBy('creatTime', 'desc').get().then(res => {
return res
})
}