20 lines
422 B
JavaScript
20 lines
422 B
JavaScript
const mongoose = require('mongoose');
|
|
const mongoosePaginate = require('mongoose-paginate-v2');
|
|
|
|
|
|
function PDF(pdf) {
|
|
if (pdf) return '/uploads/files/ReadOnly-PDF' + pdf
|
|
}
|
|
const BookSchema = mongoose.Schema({
|
|
title: String,
|
|
uri: String,
|
|
slides:{
|
|
default:[],
|
|
type:Array
|
|
}
|
|
});
|
|
|
|
BookSchema.plugin(mongoosePaginate);
|
|
|
|
module.exports = mongoose.model('Book', BookSchema);
|