title: Select rows in Sequelize where belongs-to-many association does not exist?
body: <p>I have three models in Sequelize: <code>Foo</code>, <code>Bar</code>, and <code>FooBar</code>:</p>
  
  <pre><code>FooBar.associate = models =&gt; {
    models.Foo.belongsToMany(Bar, { through: FooBar });
    models.Bar.belongsToMany(Foo, { through: FooBar });
  }
  </code></pre>
  
  <p>I want to select all rows in <code>Foo</code> where no corresponding row exists in <code>FooBar</code> for <code>fooId</code> equalling that of the <code>Foo</code> model, and for <code>barId</code> equalling a specific value.</p>
  
  <p>In SQL it would look something like this:</p>
  
  <pre><code>WHERE NOT EXISTS (
    SELECT
      1
    FROM
      fooBar
    WHERE
      fooBar . fooId = foo . fooId AND
      fooBar . barId = &lt;arbitrary value&gt;
  )
  </code></pre>
  
  <p>I understand that I can use a raw query, but obviously I would rather use a Sequelize query for completing this.</p>