当前位置:K88软件开发文章中心编程全书微信小程序 → 文章内容

微信小程序云开发服务端数据库API 指定筛选条件

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-15 15:03:17

由 Carrie 创建, 最后一次修改 2018-11-14 Collection.where指定筛选条件方法签名如下:function where(rule: object): Query方法接受一个必填对象参数 rule,用于定义筛选条件示例代码找出未完成的进度 50 的待办事项:const cloud = require('wx-server-sdk')cloud.init()const db = cloud.database()exports.main = async (event, context) => { try { return await db.collection('todos').where({ done: false, progress: 50 }) .get() } catch(e) { console.error(e) }}

微信小程序云开发服务端数据库API 指定筛选条件