db.command.and

查询指令,用于表示逻辑 "与" 的关系,表示需同时满足多个查询筛选条件

示例代码

如筛选出进度大于 50 小于 100 的 todo:

流式写法:

  1. const _ = db.command
  2. db.collection('todo').where({
  3. progress: _.gt(50).and(_.lt(100))
  4. })

前置写法:

  1. const _ = db.command
  2. db.collection('todo').where({
  3. memory: _.and(_.gt(50), _.lt(100))
  4. })

原文: https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/database/command.and.html