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
User.collection().query(function (qb) { qb.join('courses', 'users.id', 'courses.user_id'); qb.groupBy('users.id'); qb.select("users.*"); qb.count('* as course_count'); qb.orderBy("course_count", "desc"); })