我想在一个问题中显示API中的男女人数。性别:女性为1,性别为2:男性。我正在使用猫鼬和节点。
constant.js:
const PERSON__GENDER = [
{
"id": 0,
"label": "Gender Indicate",
"value": 0,
"color": null,
"active": 1
},
{
"id": 1,
"label": "Woman",
"value": 1,
"color": null,
"active": 1
},
{
"id": 2,
"label": "Man",
"value": 2,
"color": null,
"active": 1
}
];
此密码为女性:
reportController.countgender=CHS.controllerWithConn(function (req, res, mongoConn, sessionUser, response, {Employee, Location, Title, Department}) {
Employee.count({genderId:Constants.PERSON__GENDER[1].id})
.exec(APS.commonMongooseCallback(req, res, response));
}, modelProvider);
我想在一个查询中得到两个结果