我呼吁使用 Mongoose 发送所有项目的列表,如下所示:
Project.find({ uid: req.user._id })
.then((project) => {
res.status(200).send({
status: "success",
data: {project},
message: "successful"
});
})
如何从项目对象中删除创建日期和修改日期?
Exp回应:
{
"status": "success",
"data": {
"project": [
{
"_id": "5e8baea9fe729e4d78855332",
"uid": "5e89c1bd2566a6360cf78097",
"project_name": "Test 00",
"updated_date": "2020-04-06T22:35:21.555Z",
"created_date": "2020-04-06T22:35:21.555Z",
"__v": 0
},
{
"_id": "5e8bb4f5fadc384eb73c6d59",
"uid": "5e89c1bd2566a6360cf78097",
"project_name": "Test 11",
"updated_date": "2020-04-06T23:02:13.498Z",
"created_date": "2020-04-06T23:02:13.498Z",
"__v": 0
}
]
},
"message": "successful"
}
慕桂英4014372
Smart猫小萌
相关分类