```
let schema = mongoose.Schema({
name: {type: String, default: ''}, // 名称
imageUrl: {type: String, default: ''}, // 图片Url
html: {type: String, default: ''}, // 正文
type: {type: String, default: ''}, // 类型
sort: {type: Number, default: 100}, // 排序
tags: {type: Array, default: []}, // 标签
isRecommend: {type: Boolean, default: false}, // 是否首页推荐
active: {type: Boolean, default: true},
deleted: {type: Boolean, default: false},
createdAt: {type: Date, default: Date.now},
updatedAt: {type: Date, default: Date.now},
})
let model = mongoose.model('article', schema, 'article')
```
网友评论