最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

Mongoose find()具有多个值

IT培训 admin 9浏览 0评论

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({

        });
回答如下:

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. 暂无评论