title: Mongoose aggregate giving no response
body: <p>I am trying to mongoose aggregate for grouping businesses. I have working MongoDB script. I am attaching the NodeJS with Mongoose script as well as the MongoDB code below:</p>
  
  <pre><code> History.aggregate()
          .cursor({ batchSize: 1000 })
          .group({
              _id: "$businessName",
              transactions: {
                  $push: "$$ROOT"
              },
              numberOfTransactions: {
                  $sum: 1
              }
          })
          .exec(function (err, transactions) {
              if (err) {
                  res.json({
                      "message": err.message
                  });
              } else if (transactions) {
                  // winston.info(transactions);
                  res.send(
                      transactions
                  );
              }
          });
  </code></pre>
  
  <p>Working MongoDb code:</p>
  
  <pre><code>db.getCollection('transactionhistories')
          .aggregate([ 
          {$group:
              {_id:"$businessName", transactions:{$push:"$$ROOT"},numberOfTransactions: { $sum: 1 }},
           },
          {$sort:{businessId:1}}
  
              ]).toArray()
  
  </code></pre>
  
  <p>I am not receiving any response when using the first code. Can someone help? Thanks in advance!</p>