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不是函数