云数据库查询 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”
为什么编 译不过呢?
1 回复
这个需要基础库2.8.3以上支持,基础库2.8.1下报错是正常的,请参考:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/database/command.elemMatch.html