title: Dedupe MongoDB Collection
body: <p>I'm new to NoSQL, so sorry if this is very basic. Let's say I have the following collection:</p>
  
  <pre><code>{
      a: 1,
      b: 2,
      c: 'x'
  },
  {
      a: 1,
      b: 2,
      c: 'y'
  },
  {
      a: 1,
      b: 1,
      c: 'y'
  }
  </code></pre>
  
  <p>I would like to run a "Dedupe" query on anything that matches:</p>
  
  <pre><code>{
      a: 1,
      b: 2
      ... (any other properties are ignored) ...
  },
  </code></pre>
  
  <p>So after the query is run, either of the following remaining in the collection would be fine:</p>
  
  <pre><code>{
      a: 1,
      b: 2,
      c: 'y'
  },
  {
      a: 1,
      b: 1,
      c: 'y'
  }
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>{
      a: 1,
      b: 2,
      c: 'x'
  },
  {
      a: 1,
      b: 1,
      c: 'y'
  }
  </code></pre>
  
  <p><strong>Just so long as there's only one document with a==1 and b==2 remaining.</strong></p>