【发布时间】:2019-07-10 00:20:12
【问题描述】:
我正在尝试使用 thisCart 数组从产品集合中查找()多个 id,该数组还有一些我想比较的 id。 我尝试了几种方法都没有成功。
cart.findOne({"user_id": userId, "activeCart": true}).then(thisCart => {
Product.find({"product_id": prodId})
// here thisCart bring back arrays with multi ids
// which I want to do foreach thisCart[i].id = Product.product_id
// and eventually get all the products which equal to thisCart[i].id
res.status(200).json({
});
【问题讨论】: