从猫鼬填充值后,无法为nodejs中的变量分配值,并且最大变量的值未更改
var maximum=0
CollectionTimeTable.find(query,opts)
.then(docs => {
docs.forEach( async (item)=> {
// console.log(item._id)
let count= await CollectionTicket.countDocuments({entryTime:2-8});
if(count > maximum){
maximum=count
}
});
res.json(maximum);
}).catch(err => {
res.status(500).send({
message: err.message || "Some error occurred while retrieving resourcess."
});
});