【问题标题】:Api query from mongodb Show TypeError: null is not a function来自 mongodb 的 Api 查询 Show TypeError: null is not a function
【发布时间】:2018-11-15 17:53:51
【问题描述】:
router.get('/player', function(req, res) { 
    players.find(null) 
           .then(data =>{ 
               res.json({ confirmation: 'success', data: data }) 
           })
           .catch(err =>{ 
               res.json({ confirmation: 'fail', message: err.message }) 
           }) 
});

【问题讨论】:

    标签: node.js mongodb api mean-stack


    【解决方案1】:

    如果您想要所有结果,请尝试players.find({})

    【讨论】:

      猜你喜欢
      • 2017-11-19
      • 2015-12-09
      • 1970-01-01
      • 2022-10-22
      • 1970-01-01
      • 1970-01-01
      • 2015-06-24
      • 1970-01-01
      • 2017-08-27
      相关资源
      最近更新 更多