2017-10-09 22:01:02 -04:00
|
|
|
var mongoose = require('mongoose');
|
|
|
|
|
|
|
|
var UploadSchema = mongoose.Schema({
|
2018-09-15 16:20:14 -04:00
|
|
|
uid: {
|
2018-07-26 13:17:37 -04:00
|
|
|
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
|
|
|
|
},
|
2018-07-26 16:51:27 -04:00
|
|
|
|
2018-07-26 13:17:37 -04:00
|
|
|
file: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
}
|
2017-10-09 22:01:02 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Upload', UploadSchema);
|