文档代码【示例代码 2:与条件语句组合使用】少了一个边括号?
发布于 3 年前 作者 zhuxia 11746 次浏览 来自 官方Issues

https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/database/command/Command.expr.html

const _ = db.command
const $ = _.aggregate
db.collection('items').where(_.expr(
  $.lt(
    $.cond({
      if: $.gte('$price', 10),
      then: $.multiply(['$price', '0.5']),
      else: $.multiply(['$price', '0.8']),
    })
    ,
    8
  )
).get()
1 回复

你好,反馈已收到,我们核实下。

回到顶部