wikijs-fork/server/models/upl-file.js

47 lines
686 B
JavaScript
Raw Normal View History

2017-02-09 01:52:37 +00:00
'use strict'
const Mongoose = require('mongoose')
/**
* Upload File schema
*
* @type {<Mongoose.Schema>}
*/
2016-11-21 01:09:50 +00:00
var uplFileSchema = Mongoose.Schema({
2017-02-09 01:52:37 +00:00
_id: String,
category: {
type: String,
required: true,
default: 'binary'
},
mime: {
type: String,
required: true,
default: 'application/octet-stream'
},
extra: {
type: Object
},
folder: {
type: String,
ref: 'UplFolder'
},
filename: {
type: String,
required: true
},
basename: {
type: String,
required: true
},
filesize: {
type: Number,
required: true
}
2017-02-09 01:52:37 +00:00
}, { timestamps: {} })
2017-02-09 01:52:37 +00:00
module.exports = Mongoose.model('UplFile', uplFileSchema)