moved the pagination info method from express to mongoose