title: How to remove through table attributes?
body: <p>I have four models:</p>
  
  <pre><code>Category
  Video
  VideoCategory
  VideoSchedule
  </code></pre>
  
  <p>With these relationships:</p>
  
  <pre class="lang-js prettyprint-override"><code>Category.belongsToMany(Video, { through: VideoCategory })
  Video.belongsToMany(Category, { through: VideoCategory })
  Video.hasOne(VideoSchedule)
  VideoSchedule.belongsTo(Video)
  </code></pre>
  
  
  
  <p>I want to retrieve a list of categories for currently scheduled videos. I am very close, but Sequelize keeps giving me the attributes from the through table when all I want is the <code>Category.id</code> and <code>Category.name</code>. Here is my Sequelize:</p>
  
  <pre class="lang-js prettyprint-override"><code>Category.findAll({ 
    attributes: ['id', 'name'], 
    raw: true, 
    group: 'Category.id', 
    order: 'Category.name', 
    include: [
      { 
        model: Video, 
        attributes: [], 
        where: { active: true }, 
        through: { attributes: [] }, 
        include: [
          { 
            model: 
            VideoSchedule, 
            attributes: [], 
            where: { site_id: 106 }
          }
        ]
      }
    ]
  }).then(function(cats) { console.log(cats); } );
  </code></pre>
  
  
  
  <p>Here's a sample of the output I am getting:</p>
  
  <pre class="lang-js prettyprint-override"><code>{ id: 1,
    name: 'Comedy',
    'Videos.VideoCategory.category_id': 1,
    'Videos.VideoCategory.video_id': 962 },
  { id: 2,
    name: 'Drama',
    'Videos.VideoCategory.category_id': 2,
    'Videos.VideoCategory.video_id': 914 }
  </code></pre>
  
  
  
  <p>What I really want is just <code>{ id: 1, name: 'Comedy' }, { id: 2, name: 'Drama'}</code>. How do I get rid of the extra attributes from the through table? I tried using <code>through: { attributes: [] }</code> in my <code>include</code> statement, but to no avail. Just to be thorough, here is the SQL statement generated by Sequelize:</p>
  
  <pre class="lang-js prettyprint-override"><code>SELECT 
  `Category`.`id`, 
  `Category`.`name`, 
  `Videos.VideoCategory`.`category_id` AS `Videos.VideoCategory.category_id`, 
  `Videos.VideoCategory`.`video_id` AS `Videos.VideoCategory.video_id` 
  FROM 
  `categories` AS `Category` 
  INNER JOIN (`video_categories` AS `Videos.VideoCategory` 
    INNER JOIN `videos` AS `Videos` ON `Videos`.`id` = `Videos.VideoCategory`.`video_id`) 
  ON `Category`.`id` = `Videos.VideoCategory`.`category_id` 
  AND `Videos`.`active` = true 
  INNER JOIN `video_schedules` AS `Videos.VideoSchedule` 
  ON `Videos`.`id` = `Videos.VideoSchedule`.`video_id` 
  AND `Videos.VideoSchedule`.`site_id` = 106 
  GROUP BY Category.id 
  ORDER BY Category.name;
  </code></pre>
  
  
  
  <p>Any insight would be appreciated!</p>