const mongoose = require('mongoose'); const Schema = mongoose.Schema; let example = new Schema( { property: {type: String, required: false, max: 100}, } ); const Example = module.exports = mongoose.model('roleRule', example); module.exports.get = (callback, limit)=> { Example.find(callback).limit(limit); }