我正在将猫鼬 ODM 用于应用程序。我正在尝试计算模型返回的项目数,如下所示:
app.post("/verifyLogin",function(request,response){
var usr=request.body.username;
var pass=request.body.password;
response.send(userModel.find({$and:[{username:"admin"},{password:"admin"}]}).count());
});
但我得到回报:
{
"options": {
"populate": {}
},
"_conditions": {
"$and": [
{
"username": "admin"
},
{
"password": "admin"
}
]
},
"_updateArg": {},
"op": "count"
}
我期待一个数字:(