title: Problems with Mongo value-in-array query: $not operator doesn't work, and ObjectIds cannot be selected
body: <p>I am trying to select a document which does NOT contain a value in a document's array.  </p>
  
  <p>I'm having two problems, which I'll present separately:</p>
  
  <p>(1)  I cannot get the $not operator to work with a value-in-array query:
  For example, if I have the following document in my collection:</p>
  
  <p><code>
  { _id: ObjectId("000000000000000000000000"),
    mylist: [ "red", "green", "blue" ] }
  </code></p>
  
  <p>I can select this document using:</p>
  
  <p><code>
  db.myCol.find({mylist:"red"})
  </code></p>
  
  <p>However, I would like to select this document by testing for the absence of orange:</p>
  
  <p><code>
  db.myCol.find({$not:{mylist:"orange"}})
  </code></p>
  
  <p>Why does this not work?</p>
  
  <p>(2) I cannot get the value in array query to work if the array values are ObjectIds:</p>
  
  <p><code>
      { _id: Object("000000000000000000000000"),
        mylist: [ ObjectId("111111111111111111111111") ] }
  </code></p>
  
  <p>The following does NOT retrieve this document:</p>
  
  <p><code>
      myCol.find({mylist:ObjectId("111111111111111111111111")})
  </code></p>
  
  <p>Can someone suggest what I might be doing wrong?</p>