title: How do I fix this query to get my result?
body: <p>How do I frame my query in mongodb?
  to show Which id has the most pics? show list numbers and counts of pics.</p>
  <p>I have a json file with the data
  here is a sample of the data.</p>
  <pre><code>    {
          &quot;Id&quot; : 1,
          &quot;name&quot; : &quot;Mu&quot;,
          &quot;Id&quot; : 1,
          &quot;pics&quot; : 5
      },
  </code></pre>
  <p>I have tried but this is not what I want? How can I fix the query?</p>
  <pre><code>$group: {
              _id: &quot;$Id &quot;,
              count: {$sum: 1} 
          } 
  </code></pre>