You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
455 B
27 lines
455 B
// const mongoose = ('mongoose')
|
|
import mongoose from 'mongoose'
|
|
|
|
const ArticleSchema = new mongoose.Schema({
|
|
cover: {
|
|
type: String
|
|
},
|
|
title: String,
|
|
content: String,
|
|
category: String,
|
|
tagList: [],
|
|
views: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
createTime: {
|
|
type: Date,
|
|
default: Date.now()
|
|
},
|
|
updateTime: {
|
|
type: Date,
|
|
default: Date.now()
|
|
}
|
|
})
|
|
|
|
export default mongoose.model('Article', ArticleSchema, 'article')
|