title: MongoDB: determining if there are any objects with a specific count for a particular sub-array value
body: <p>Essentially, I have:</p>
  <ul>
  <li>a <code>bands</code> collection</li>
  <li>each band <em>may or may not</em> have an array of <code>players</code></li>
  <li>each player has an array of <code>roles</code> (string)</li>
  </ul>
  <p>E.g.:</p>
  <pre><code>// a band
  {
    _id: 1,
    players: [
      { 
        name: &quot;George&quot;,
        roles: [ &quot;GUITAR&quot; ]
      },
      { 
        name: &quot;John&quot;,
        roles: [ &quot;SINGER&quot;, &quot;GUITAR&quot; ]
      },
      { 
        name: &quot;Paul&quot;,
        roles: [ &quot;SINGER&quot;, &quot;BASS GUITAR&quot; ]
      },
      { 
        name: &quot;Ringo&quot;,
        roles: [ &quot;DRUMS&quot; ]
      },
    ]
  }
  </code></pre>
  <p>I need to determine if there is <em>any</em> band which contains <em>more than one</em> member having the <em>SINGER</em> role.</p>