16 lines
334 B
JavaScript
16 lines
334 B
JavaScript
const mongoose = require('mongoose')
|
|
|
|
function catalog(pdf) {
|
|
return '/uploads/pdf/' + pdf
|
|
}
|
|
|
|
const MainCatalogSchema = mongoose.Schema({
|
|
file: {type: String, get: catalog},
|
|
created_at: String
|
|
}, {
|
|
toObject: {getters: true},
|
|
toJSON: {getters: true}
|
|
})
|
|
|
|
module.exports = mongoose.model('MainCatalog', MainCatalogSchema)
|