html52.com
我爱小程序-开发者交流社区

云数据库查询 elemMatch 为什么编译不通过?

TypeError: _.elemMatch is not a function
    at _callee$ (index.js:20)
    at L (regenerator.js:1)
    at Generator._invoke (regenerator.js:1)
    at Generator.t.(:62191/appservice/anonymous function) [as next] (http://127.0.0.1:62191/appservice/@babel/runtime/regenerator.js:1:5081)
    at asyncGeneratorStep (asyncToGenerator.js:1)
    at c (asyncToGenerator.js:1)
    at asyncToGenerator.js:1
    at new Promise (<anonymous>)
    at ye.<anonymous> (asyncToGenerator.js:1)


我代码有么问吗?

table.field({
     _id: true,
     profiles: true
   }).where({
     profiles: _.elemMatch(
       { age: _.gt( 10 ), name: _.neq(null) } )
 
   }) .get();


我的开发工具版本 Stable v1.02.1907300

project.config.json 设置         "libVersion": "2.8.1"

为什么编 译不过呢?



网友回复

nickname:

这个需要基础库2.8.3以上支持,基础库2.8.1下报错是正常的,请参考:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/database/command.elemMatch.html

ogram/dev/wxcloud/reference-client-api/database/command.elemMatch.html

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付