猫鼬发现不是一个功能

时间:2017-09-07 18:38:27

标签: node.js mongoose

我有一个报告模型:

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)
  })

1 个答案:

答案 0 :(得分:0)

真正的问题是我认为该模型已被添加,但事实并非如此。