A Mongoose helper to simplify the pagination process.