Why does Express.js populate method fail in this application?
问题 I am working on a blogging application (click the link to see the GitHub repo) with Express, EJS and MongoDB. I have Posts and Post Categories , each in its own collection. The Categories Schema: const mongoose = require('mongoose'); const categorySchema = new mongoose.Schema({ cat_name: { type: String, required: true }, updated_at: { type: Date, default: Date.now() }, created_at: { type: Date, default: Date.now() } }); module.exports = mongoose.model('Category', categorySchema); The Posts