const $ = db.command.project await db.collection( 'chat' ).where({ _id: event.id }).field({ _id: true , chatReqUserId: true , chatResUserId: true , record: $.slice(-2) }).get() |
const $ = db.command.project await db.collection( 'chat' ).where({ _id: event.id }).field({ _id: true , chatReqUserId: true , chatResUserId: true ,
tags: $.slice(-2)
}).get() |
报错信息: Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 9e68d720-fa24-11e9-b2dd-525400e8849e, cloud function service error code -504002, error message errCode: -501007 invalid parameters | errMsg: [InvalidParameterValue.QueryProjection] Query projection entered in the request is illegal. Please check your request, but if the problem persists, contact us.; ; at cloud.callFunction api;
两种方法都测试过了,返回了同样的报错信息,然后在command列表文档下也找不到project这个方法,不知道是否是该方法已被废除,求大佬帮忙,万分感谢