title: Model Error using Mongoose Pagination Package
body: <p>I am trying to use the <a href="https://github.com/edwardhotchkiss/mongoose-paginate" rel="nofollow">mongoose-pagination</a> package and tried to follow the documentation provided, but it doesn't appear to be working with my model. I am getting this error message:</p>
  
  <pre><code>/Users/user/Desktop/Projects/node/blog/app/models/blogModel.js:16
  BlogPostSchema.paginate({}, 2, 10, function(error, pageCount, paginatedResults
                 ^
  TypeError: Object #&lt;Schema&gt; has no method 'paginate'
      at Object.&lt;anonymous&gt; (/Users/user/Desktop/Projects/node/blog/app/models/blogModel.js:16:16)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Module.require (module.js:364:17)
      at require (module.js:380:17)
      at Object.&lt;anonymous&gt; (/Users/user/Desktop/Projects/node/blog/server.js:18:16)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
  </code></pre>
  
  <p>And i'm not sure why I am receiving this error because the plugin is supposed to allow for the paginate method.</p>
  
  <p>blogModel.js:</p>
  
  <pre><code>var mongoose    = require('mongoose');
  var Schema      = mongoose.Schema;
  var mongoosePaginate = require('mongoose-paginate');
  
  
  
  var BlogPostSchema  = new Schema({
          title: String,
          author: String,
          content: String,
          date: { type: Date, default: Date.now }
  });
  
  BlogPostSchema.plugin(mongoosePaginate);
  
  BlogPostSchema.paginate({}, 2, 10, function(error, pageCount, paginatedResults, itemCount) {
      if (error) {
          console.error(error);
      } else {
          console.log('Pages:', pageCount);
      }
  });
  
  module.exports = mongoose.model('Blogpost', BlogPostSchema);
  </code></pre>