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

// const mongoose = ('mongoose')
import mongoose from 'mongoose'
const ArticleSchema = new mongoose.Schema({
2 years ago
cover: {
type: String
},
title: String,
content: String,
2 years ago
category: String,
tagList: [],
2 years ago
views: {
type: Number,
default: 0
},
createTime: {
type: Date,
default: Date.now()
},
updateTime: {
type: Date,
default: Date.now()
}
})
2 years ago
export default mongoose.model('Article', ArticleSchema, 'article')