You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
612 B
JavaScript
19 lines
612 B
JavaScript
4 years ago
|
var mongoose = require('mongoose');
|
||
|
var Schema = mongoose.Schema;
|
||
|
|
||
|
var NewsSchema = new Schema({
|
||
|
title: {type: String, required: true},
|
||
|
urlslug: {type: String, required: true, lowercase: true, unique: true},
|
||
|
headerImage: String,
|
||
|
bodyImages: [String],
|
||
|
excerpt: {type: String, required: true},
|
||
|
contents: {type: String, required: true},
|
||
|
publishTime: {type: Number, required: true},
|
||
|
expireTime: {type: Number, required: true} // -1 for never on carousel, 0 for forever, unix date otherwise
|
||
|
});
|
||
|
|
||
|
var News = mongoose.model('News', NewsSchema);
|
||
|
|
||
|
module.exports.model = News;
|
||
|
module.exports.schema = NewsSchema;
|