最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Mongoose find()具有多个值

运维笔记admin10浏览0评论

Mongoose find()具有多个值

Mongoose find()具有多个值

我试图通过使用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({

        });
回答如下:

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论