Breeze.js: How to write a query using json for "not in listvalues" where clause
<p>I am using breeze.js on the client and breeze_sequel (breeze+sequelize) on my nodejs backend and every thing works fine. Now I'am not able to perform a query of this type:</p>

<pre><code>select * from MyTable 
where Field1 = 'foo' and Field1 not in ('some_value1', 'some_value2')
</code></pre>

<p>From my javascript client this is the json where clause I am building and sending over the wire:</p>

<pre><code>var where = {
            'and': [
                { 'Field1': { 'eq': 'foo'} },                    
                {
                    not: [
                           {
                            'Field2': { in: ['value1', 'value1'] }
                         }
                    ]
                }
            ]
        }
</code></pre>

<p>From the server console output, I can see that the "not" clause is not applied in my query. This is the query sent to the database:</p>

<pre><code>SELECT * FROM MYTABLE WHERE
FIELD1 = 'foo' AND FIELD2 IN ('value1','value2')
</code></pre>

<p>I dived into the source code of the breeze_sequel library (especially the file SequelizeQuery.json.js ) to see how the library translate my predicates into actual sql "where clause" and I saw these comments on the method "applyNot(q1)" (line 724) which obviously applies the "not" clause to a query:</p>

<pre><code>    // rules are:
  // not { a: 1}             -&gt; { a: { ne: 1 }}
  // not { a: { gt: 1 }}    -&gt; { a: { le: 1}}}
  // not { and: { a: 1, b: 2 } -&gt; { or:  { a: { $ne: 1 }, b: { $ne 2 }}}
  // not { or  { a: 1, b: 2 } -&gt; { and: [ a: { $ne: 1 }, b: { $ne 2 }]}
</code></pre>

<p>It looks to me like breeze_sequel does not support whereclause of the type " where xxx not in ( <strong>list</strong> ) ". Is it a missing feature or maybe I am doing some mistake? (I would like to avoid to write a special service on the server side to handle these kinds of query). </p>

<p>Thank you in adavance, especially to the guys from breeze.js. (kudos for this wonderful library)</p>