const mongoose = require('mongoose');
const Schema = mongoose.Schema;

let chapter = 
new Schema(
    {
        scanlator: {type: String, required: true, max: 100},
        title: {type: String, required: true, max: 100},
        link:{type: String, require:true, max:100},
        chapterNum:{type: Number, require:true}
    }
);

const Chapter = module.exports = mongoose.model('chapter', chapter, 'mangareader');
module.exports.get = (callback, limit)=>
{
   Chapter.find(callback).limit(limit); 
}