我有一个报告模型:
const mongoose = require('mongoose');
var Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
const reportSchema = new mongoose.Schema({
score: Number,
notes: String,
user: ObjectId,
date: Date
}, {timestamps: true})
const Report = mongoose.model('Report', reportSchema);
module.exports = Report
但是当我发现它说功能不存在时:
report.find({}, function(err, docs){
console.log(docs)
})
答案 0 :(得分:0)
真正的问题是我认为该模型已被添加,但事实并非如此。