5.3.2.7. where¶
指定筛选条件
-
cloud.database.collection.
where
(rule)¶ 指定筛选条件
- 参数
rule (object) – 筛选条件
- 返回类型
Query
- 示例
找出未完成的进度 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) } }