1.cmd输入limit为字段 skip为下标
//limit(2) 只会获取两条数据db.top250.find().limit(2)//skip() 下标db.top250.find().skip(1).limit(2)
2.前端处理limit和下标
http://localhost:8080/top250?start=0&count=5;start-->为下标count-->为限制
3.index.js
router.get("/top250",async ctx=>{console.log(ctx.query)var {start,count} = ctx.queryconsole.log(start)if(start==undefined){start = 0}if(count == undefined){count = 5}var data = await Top250Model.find({}).skip(Number(start)).limit(Number(count));ctx.body = {data,code:200}})
