微信小程序云開發服務端數據庫API Collection.skip
Collection.skip / Query.skip
指定查詢返回結果時從指定序列后的結果開始返回,常用語分頁
方法簽名如下:
function skip(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)
}
}
中國· 上海

添加微信咨詢
CopyRight?2009-2019 上海谷谷網絡科技有限公司 All Rights Reserved. 滬ICP備11022482號-8
- top
- 在線咨詢
-
添加微信咨詢