代码:
return db.collection("welfarePrizes_activity").aggregate().project({
matched: _.gte(['$attendNum','$openNum']),
}).match({
matched: true,
}).limit(1).end().then((result)=>{})
异常:
{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Error: errCode: -502001 database request fail | errMsg: [FailedOperation] (Location40180) Invalid $project :: caused by :: an empty object is not a valid value. Found empty object at path matched.fieldName; \n at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:7819:16)\n at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1424:23)\n at Promise (/var/user/node_modules/wx-server-sdk/index.js:1163:33)\n at process._tickCallback (internal/process/next_tick.js:68:7)"}
你是从哪个文档上得知能这么用的,多半是错的