find({}) returns an empty array mongoose
问题 Here is my code in model.js file: const mongoose = require("mongoose"); const con = require("./connection"); con(); const schoolNotices = mongoose.model("schoolNotices", { title:{ type: String }, date:{ type:String }, details:{ type:String } }); module.exports = schoolNotices; And I have imported this code into students.js file router.route("/notices") .get((req,res)=>{ schoolNotices.find({},(err,docs)=>{ if(err){ return console.log(err) } res.render("studentNotices",{title:"Notices",data