Files
arakrail/api/models/MainCatalog.js
T
Amir Mohamadi bc5e617778 back-end done
2020-12-10 16:36:48 +03:30

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)