MongoDB在不应该返回结果时返回结果

时间:2017-07-22 08:38:08

标签: mongodb express mongoose

我正在搜索集合中的数组,Mongodb(Mongoose)返回一个空数组,即使我知道它不应该找到我提交的URL路径。

router.use(function(req, res, next) {

var path = req.url;

db.find({arrayOfPaths:path})
 .then(function(db){

  console.log(db);

  //db returns empty array why?

  res.status(200).render('results', {db});
  })

  .catch()

})

0 个答案:

没有答案
相关问题