var mongoose = require('mongoose'); var Schema = mongoose.Schema; var MediaSchema = new Schema({ name: {type: String, required: true}, urlslug: {type: String, required: true, unique: true}, uploaded: {type: Number, required: true}, filename: {type: String, required: true, unique: true}, thumbnail: {type: String}, mimetype: {type: String, required: true}, width: {type:Number,required:true}, height: {type:Number,required:true} }); var Media = mongoose.model('Media', MediaSchema); module.exports.model = Media; module.exports.schema = MediaSchema