title: How to push all set of record into one array using MongoDB query
body: <p>I need to push all records into one array while executing the mongoDB query. I am explaining my query below.</p>
  
  <pre><code>db.getCollection('orders').aggregate([
      {
          $match: {"Customer.StoreCode":"CMHB"}
      },
      {
          $group: {_id : "$Customer.CustomerMobile", "data" : {"$first" : "$$ROOT"}}
      },
      {
          $project: {
              OrderNumber:"$data.OrderNumber",
              OrderStatus:"$data.OrderStatus",
              OrderType:"$data.OrderType",
              CreatedAt:"$data.CreatedAt",
              CustomerMobile: "$data.Customer.CustomerMobile",
              CustomerLastName:"$data.Customer.CustomerLastName",
              CustomerFirstName:"$data.Customer.CustomerFirstName",
              StoreCode:"$data.Customer.StoreCode",
              TransactionId:"$data.PaymentDetails.TransactionId",
              PaymentStatus:"$data.PaymentDetails.PaymentStatus",
              PaymentAmount:"$data.PaymentDetails.PaymentAmount",
              ItemNos: { $cond: { if: { $isArray: "$data.Products" }, then: { $size: "$data.Products" }, else: "NA"} }
          }
      }
  ])
  </code></pre>
  
  <p>Here I am getting Some records as per store code and mobile no. Here I need to push all records into one array using that same query.</p>