微信小程序云开发API 指定查询排序条件


当前第2页 返回上一页

按进度排升序取待办事项

const db = wx.cloud.database()
db.collection('todos').orderBy('progress', 'asc')
  .get()
  .then(console.log)
  .catch(console.error)

示例代码:按多个字段排序

先按 progress 排降序(progress 越大越靠前)、再按 description 排升序(字母序越前越靠前)取待办事项:

const db = wx.cloud.database()
db.collection('todos')
  .orderBy('progress', 'desc')
  .orderBy('description', 'asc')
  .get()
  .then(console.log)
  .catch(console.error)

标签:微信小程序

返回前面的内容

相关阅读 >>

微信小程序工具 命令行调用

微信小程序 快递接口(商家查看)-下载打单软件

微信小程序 用户签约状态查询

微信小程序表单组件 表单组件 picker

sdk数据库 aggregate过滤文档

微信小程序导航 navigation-bar

微信小程序工具 beta版本下载

微信小程序 wxs模块

微信小程序api 获取用户过去三十天微信运动步数

微信小程序api 文件-删除本地缓存文件

更多相关阅读请进入《微信小程序》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...