Collection.skip / Query.skip

指定查询返回结果时从指定序列后的结果开始返回,常用语分页

方法签名如下:

  1. function skip(offset: number): Collection | Query

示例代码

  1. const cloud = require('wx-server-sdk')
  2. cloud.init()
  3. const db = cloud.database()
  4. exports.main = async (event, context) => {
  5. try {
  6. return await db.collection('todos').skip(10).get()
  7. } catch(e) {
  8. console.error(e)
  9. }
  10. }

原文: https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-server-api/database/collection.skip.html