显示mongo错误代码16006
Windows节点服务器
我的模型在这里: 项目:{
fundingInfo : [
{
investAmount : Number,
investDate : Date
}
]
and query is:
Projects.aggregate(
{
$project:{
year:{$year:"$fundingInfo.investDate"},
month:{$month:"$fundingInfo.investDate"},
"fundingInfo" : 1,
"_id" : 1
}
},
{
$unwind:"$fundingInfo"
},
{
$match :
{
"_id": new mongoose.Types.ObjectId(projectRefId),
"year" : new Date().getFullYear()
}
},
{
$group : {
_id : {year : "$year", month : "$month"},
total : {$sum : "$fundingInfo.investAmount"}
}
}
....
在执行时,显示错误: MongoError”,消息:“无法从缺少的BSON类型转换为日期”,确定:0,…} 代码:16006