title: Use of $nin on embedded document
body: <p>I have a schema like this in MongoDB:</p>
  
  <pre><code>var Customers = new Schema({
      name: { type: String, trim: true, index: true, default: null, sparse: true },
      facebookId: { type: String, default: null, trim: true, index: true },
      friends: [friends]
  });
  
  var friends = new Schema({
      customer: { type: Schema.ObjectId, ref: 'Customers', required: true },
      lastGame: { type: Schema.ObjectId, ref: 'games', required: true, default: null },
      lastGameTime: { type: Date, default: null }
  });
  </code></pre>
  
  <p>Now in <strong>friends</strong> array I have reference of all the customer who are Facebook friend of the particular customer.</p>
  
  <p>Now what I want to do is I have a screen where I want to show all the customers but there I don't want to those customers who are already my Facebook friends i.e for an example lets suppose I have <strong>10 customer in total from 1 to 10</strong>, I am <strong>customer no</strong> <strong>4</strong> who have <strong>customer 1,3,5,6 in friends array</strong> so my result on the screen should be of <strong>user 2,7,8,9,10</strong></p>
  
  <p>I will really be thankful if someone can tell me the way to this stuff by using Query of MongoDb. I have searched and found <strong><code>$nin</code></strong> usage but that works in simple array. I don't get how I can implement this query on an embedded document as in the case of mine. </p>