title: How to use groupBy in Bookshelf js?
body: <p>how to use groupBy in <strong>Bookshelf JS</strong>, here is my Controller code.</p>
  
  <pre><code>router.route('/fetchStudentAttendance')
  .post(function(req, res) {
   StudentAttendance
    .query(function (qb){
      qb.where('date', '&gt;=', req.body.date);
      qb.groupBy("students_id");
    })
  .where({'class_id': req.body.class_id, 'section_id': req.body.section_id})
  .fetchAll({ withRelated: [{'StudentRef':function(qb) {qb.column('id', 'first_name', 'middle_name', 'last_name')}}]})
  .then(studentAttendance =&gt; {
    let content = {
      data: studentAttendance,
      success: true,
      message: 'Record Not Found',
    };
    return res.send(content);
  })
  .catch(error =&gt; {
    let content = {
        data: error,
        success: false,
        message: 'Error while fetching Student Attendance.',
      };
    return res.send(content);
  });
  </code></pre>
  
  <p>});</p>
  
  <p>when i am trying to "groupBy" employee_id it will give Error like this.</p>
  
  <pre><code>code:"42703"
  file:"parse_relation.c"
  length:110
  line:"3194"
  name:"error"
  position:"127"
  routine:"check_ungrouped_columns_walker"
  severity:"ERROR"
  </code></pre>