2017-10-09 22:01:02 -04:00
|
|
|
var mongoose = require('mongoose');
|
|
|
|
|
|
|
|
var UploadSchema = mongoose.Schema({
|
|
|
|
name: {
|
|
|
|
type: String,
|
2018-07-26 13:17:37 -04:00
|
|
|
required: true
|
|
|
|
},
|
|
|
|
|
|
|
|
id: {
|
|
|
|
type: String,
|
2017-10-09 22:01:02 -04:00
|
|
|
unique: true,
|
|
|
|
required: true
|
|
|
|
},
|
2018-07-26 13:17:37 -04:00
|
|
|
|
2017-10-14 15:13:50 -04:00
|
|
|
views: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
2018-07-26 13:17:37 -04:00
|
|
|
|
|
|
|
uploader: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
|
|
|
|
uploaderKey: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
|
|
|
|
date: {
|
|
|
|
type: Date,
|
|
|
|
default: Date.now
|
|
|
|
},
|
|
|
|
|
|
|
|
mime: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
file: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
}
|
2017-10-09 22:01:02 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Upload', UploadSchema);
|