I was searching high and low to find how to do basic counting (like SELECT COUNT(something) FROM table) with Bookshelf.js, but to no avail. Is there anything I\'m missing? Or is
Here is a really simple solution just use Bookshelf.knex.raw('count(id) as count')
ReactionsDb .query(function(qb) { qb.groupBy('reaction_type'); }) .fetchAll({columns: ['reaction_type', Bookshelf.knex.raw('count(id) as count')]});