This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Query blog posts by user -> paginated results and a total count. | |
* @param userId {ObjectId} ID of user to retrieve blog posts for | |
* @param startRow {Number} First row to return in results | |
* @param endRow {Number} Last row to return in results | |
* @param [filter] {Object} Optional extra matching query object | |
* @param [sort] {Object} Optional sort query object | |
* @returns {Object} Object -> `{ rows, count }` | |
*/ | |
function queryBlogPostsByUser (userId, startRow, endRow, filter = {}, sort = false) { |