title: Sequelize.js query to get total count through relationship
body: <p>I'm using sequelize to get a total count through a relationship. I need it by a <code>customerId</code> that is in a parent table joined through a pivot table. The plain query looks something like this:</p>
  
  <pre><code>SELECT count(p.*) FROM parcels as p
  LEFT JOIN orders_parcels as op ON op."parcelId" = p.id
  LEFT JOIN orders as o ON op."orderId" = o.id
  WHERE o."customerId"=1
  </code></pre>
  
  <p>This works fine. But not sure how to get the sequelize query.</p>
  
  <pre><code>Parcel.findAndCountAll();
  </code></pre>
  
  <p><strong>EDIT: OrderParcel</strong></p>
  
  <pre><code>var OrderParcel = service.sequelize.define('OrderParcel', {
  
      id: {
          type: Sequelize.INTEGER,
          primaryKey: true,
          autoIncrement: true
      }
  }, {
      tableName: 'orders_parcels',
      freezeTableName: true,
      paranoid: true
  });
  
  module.exports = OrderParcel;
  
  var Order = require('./Order');
  
  OrderParcel.belongsTo(Order, {
      as: 'Order',
      foreignKey: 'orderId'
  });
  
  var Parcel = require('../parcel/Parcel');
  
  OrderParcel.belongsTo(Parcel, {
      as: 'Parcel',
      foreignKey: 'parcelId'
  });
  </code></pre>