title: Sequelize.js: Query for not in array ($ne for items in array)
body: <p>I am looking to pull items from a postgres data base with Sequelize, but only return items that have an id that does not equal any items in a given array.</p>
  
  <p>In the <a href="http://docs.sequelizejs.com/en/2.0/docs/querying/" rel="noreferrer">Sequelize documentation</a>, there are operators <code>$ne</code> for <code>not equal</code> and <code>$in</code> for returning items that have properties with values that match the given array, but it doesn't look like there is an operator for something that combines those two.</p>
  
  <p>For example, if I were to have items in my database with ids <code>[1, 2, 3, 4, 5, 6]</code>, and I wanted to filter those by comparing to another array (ie <code>[2,3,4]</code>), so that it would return items <code>[1, 5, 6]</code>. In my example i also randomize the return order and limit, but that can be disregarded.</p>
  
  <pre><code>function quizQuestions(req, res) {
    const query = {
      limit: 10,
      order: [ [sequelize.fn('RANDOM')] ],
      where: {
        id: { $ne: [1, 2, 3] } // This does not work
      }
    };
  
    Question.findAll(query)
    .then(results =&gt; res.status(200).json(map(results, r =&gt; r.dataValues)))
    .catch(err =&gt; res.status(500).json(err));
  }
  </code></pre>
  
  <p>Edit: With @piotrbienias answer, my query looks like this:</p>
  
  <pre><code>  const query = {
      limit: 10,
      order: [ [sequelize.fn('RANDOM')] ],
      where: {
        id: { $notIn: [1, 2, 3] }
      }
    };
  </code></pre>