problem description
you can use await, but why not use traditional callbacks?
related codes
router.get("/getArticles", async (ctx) => {
let { sizes, pageNum } = ctx.query
sizes = Number(sizes)
pageNum = Number(pageNum)
const skip = (pageNum - 1) * sizes
const data = await Article.find({}).skip(skip).limit(sizes)
//
ctx.body = {
code: 0,
data
}
})
what result do you expect? What is the error message actually seen?
if callback is used, how can I correct it without await?