title: I am trying to get retrive data from mongodb but not getting expected output
body: <p><strong>DB Data -</strong></p>
  <pre><code>[{
      title: &quot;Vivo X50&quot;,
      category: &quot;mobile&quot;,
      amount: 35000
  
  },
  {
      title: &quot;Samsung M32&quot;,
      category: &quot;mobile&quot;,
      amount: 18000
  
  },
  {
      title: &quot;Lenovo 15E253&quot;,
      category: &quot;laptop&quot;,
      amount: 85000
  
  },
  {
      title: &quot;Dell XPS 15R&quot;,
      category: &quot;laptop&quot;,
      amount: 115000
  }]
  </code></pre>
  <p><strong>Expected Output:</strong></p>
  <pre><code>[{
      category: &quot;mobile&quot;,
      qty: 2,
      totalAmount: 53000
  },
  {
      category: &quot;laptop&quot;,
      qty: 2,
      totalAmount: 200000
  }]
  </code></pre>
  <p><strong>Code I am running (Using mongoose)</strong></p>
  <pre><code>let products = await Product.aggregate([
      {
        $project: { _id: 0, category: 1, amount: 1 },
      },
      {
        $group: {
          _id: &quot;$category&quot;,
          qty: { $sum: 1 },
          totalAmount: { $sum: &quot;$amount&quot; },
        },
      },
    ]);
  </code></pre>
  <p><strong>Result I am Getting.</strong></p>
  <pre><code>[
  {
  &quot;_id&quot;: &quot;laptop&quot;,
  &quot;count&quot;: 2,
  &quot;totalSum&quot;: 200000
  },
  {
  &quot;_id&quot;: &quot;mobile&quot;,
  &quot;count&quot;: 2,
  &quot;totalSum&quot;: 53000
  }
  ]
  </code></pre>
  <p><strong>As you can clearly see that I am able to get correct data but I want correct name also category instead of _id. Please help me with that. Thanks in advance</strong></p>