title: Mongo - aggregate with multiple conditions
body: <p>I have collection that hold user's purchases into stores and the likes and dislikes he got for this purchase from his friends. the collection fields looks like that:</p>
  <pre><code>{
      &quot;_id&quot; : ObjectId(&quot;543e43cea7c481c4820ab014&quot;),
      &quot;user&quot; : &quot;542ea90fbb1e37b09f660980&quot;,
      &quot;product&quot; : &quot;543e43cea7c481c4820ab013&quot;,
      &quot;store&quot; : &quot;542e6fb1a2a8a7a071490555&quot;,
      &quot;status&quot; : &quot;active&quot;,
      &quot;dislikes&quot; : 1,
      &quot;likes&quot; : 3,
      &quot;addedAt&quot; : ISODate(&quot;2014-10-15T09:52:14.661Z&quot;)
  }
  </code></pre>
  <p>Now, I want to get the following summaries:</p>
  <ol>
  <li>Get the diff of (likes - dislikes) for user X</li>
  <li>Get the diff of (likes - dislikes) for user X into store Y</li>
  <li>Get the diff of (likes - dislikes) for user X into store Y and product Z</li>
  </ol>
  <p>For #1, i made:</p>
  <pre><code>[
     {$group: {_id: '$user', rankDiff: {$sum: {$subtract: ['$likes', '$dislikes']}}}},
     {$match : { _id: 'X'}}
  ],
  </code></pre>
  <p>I'm getting proper results:</p>
  <blockquote>
  <p>[
  {
  &quot;_id&quot; : &quot;542ea90fbb1e37b09f660980&quot;,
  &quot;rankDiff&quot; : 2
  } ]</p>
  </blockquote>
  <p>But when i'm trying to get #2 by:</p>
  <pre><code>[
     {$group: {_id: '$user', rankDiff: {$sum: {$subtract: ['$likes', '$dislikes']}}}},
     {$match : { _id: 'X'}, store: 'Y'}
  ],
  </code></pre>
  <p>Or to get #3 by:</p>
  <pre><code>[
     {$group: {_id: '$user', rankDiff: {$sum: {$subtract: ['$likes', '$dislikes']}}}},
     {$match : { _id: 'X'}, store: 'Y', product: 'Z'}
  ],
  </code></pre>
  <p>No results in return.</p>
  <p>Is someone can please help me with that? what I'm doing wrong?</p>
  <p>p.s. did all by Mongoose but also directly with Robomongo via my MongoDB instance</p>