Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program cloud development service-side database API Collection.skip


May 20, 2021 WeChat Mini Program Development Document


Table of contents


Collection.skip / Query.skip

When a specified query returns results, it starts with the results after the specified sequence, and is pedded in common language

The method signature is as follows:

function skip(offset: number): Collection | Query

The sample code

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)
  }
}