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;