正则表达db.RegExp用云函数没法使用?

发布于 6 年前作者 kangyang7658 次浏览最后编辑 6 年前来自 ask
  • 当前 Bug 的表现(可附上截图)

  • 预期表现

  • 复现路径

  • 提供一个最简复现 Demo

db.collection(mydbname).where({
  dalei: db.RegExp({
    regexp: this.data.dalei_tmp,
    options: 'i',
  })

})

可以正常使用。但如果使用云函数,把

{
  dalei: db.RegExp({
    regexp: this.data.dalei_tmp,
    options: 'i',
  })

}

当条件传入云函数,出现了 db 没有定义的错误提示,没法运行,请教一下问题出在哪里?高手回复一下,谢谢!



3 回复
xiulan98
xiulan981 楼6 年前

你放出来全部的云函数代码,云函数中传入的是event 一般是

jing86
jing862 楼6 年前
{
  dalei: db.RegExp({
    regexp: even.dalei_tmp,
    options: 'i',
  })

}

bxue
bxue3 楼4 年前

其他代码出错了。