谁能帮我我为什么会出现TypeError?

时间:2018-10-06 19:19:55

标签: node.js express

let express = require('express'), 
router  = express.Router(), 
passport = require('passport');  

let Artistrees = require('../models/artistree'); 


//INDEX - get/find all artists 
router.get('/', (req, res) => {
   Artistrees.find({}, (err, allArtists) => {
       if(err) {
           console.log(err); 
       } else {
           res.render('artistrees/index', {allArtists: allArtists});     
       }
   });  
});

结果:

  

TypeError:Artistrees.find不是函数

0 个答案:

没有答案