wxcloud
  • 1. 基础
  • 2. 指引
  • 3. 参考
  • 4. 小程序端 API
  • 5. 服务端 API
    • 5.1. 初始化
    • 5.2. 工具类
    • 5.3. 数据库
      • 5.3.1. db.createCollection
      • 5.3.2. 集合
        • 5.3.2.1. add
        • 5.3.2.2. update
        • 5.3.2.3. field
        • 5.3.2.4. doc
        • 5.3.2.5. get
        • 5.3.2.6. count
        • 5.3.2.7. where
        • 5.3.2.8. limit
        • 5.3.2.9. orderBy
        • 5.3.2.10. skip
      • 5.3.3. 指令
      • 5.3.4. db.Geo
      • 5.3.5. db.serverDate
      • 5.3.6. db.RegExp
    • 5.4. 存储
    • 5.5. 云函数
  • 6. 最佳实践
  • 7. 术语表
wxcloud
  • Docs »
  • 5. 服务端 API »
  • 5.3. 数据库 »
  • 5.3.2. 集合 »
  • 5.3.2.10. skip
  • View page source

5.3.2.10. skip¶

cloud.database.collection.skip(offset)¶

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

参数
  • offset (number) – 指定序列后

返回类型

Collection | Query

示例
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
exports.main = async (event, context) => {
  try {
    return await db.collection('todos').skip(10).get()
  } catch (e) {
    console.error(e)
  }
}
Next Previous

© Copyright 2019, Nosy

Built with Sphinx using a theme provided by Read the Docs.