我正在开发一种使用restify和mongoose作为odm的服务。下面是DB调用后得到的服务响应。
Posts.find({_id: catId}).populate('author')
.exec(function(err, list) {
if(err) {
return next(new errors.InvalidContentError(err.errors.name.message),);};
res.send(200, massageResponse(list, createResponse));
next();
});
});
let createResponse = function (list) {
const trimmedList = list.map((element) => {
delete element.createdAt;
return element;
});
return trimmedList;
}
let massageResponse = function (list, callback) {
return callback(list);
}
以下是我写的代码。但它没有删除响应中的属性。
=iif(Fields!nPeriodo.Value > CINT(replace(left(Split(Parameters!DimTiempoMes.Value,"[").GetValue(3),2),"]","")) ,NOTHING,Sum(Fields!PPMBSC_VentasPPM.Value))