title: Ignore null values for $last in MongoDB aggregation
body: <p>There are documents in 'account' collection. Some fields may not be declared. Look at this.</p>
  
  <pre><code>{ _id: ObjectId(1), price: 5400, product: ObjectId(2), count: 1            }
  { _id: ObjectId(1),              product: ObjectId(2), count: 0, sale: 0.2 }
  { _id: ObjectId(1),              product: ObjectId(2), count: 1            }
  </code></pre>
  
  <p>Using aggregate framework, I want to have last price, last sale and count for a product.
  Currently I use this query</p>
  
  <pre><code>db.collection('account').aggregate([
  {
      $group: {
              _id: '$product',
              count: { $sum: '$count' },
              price: { $last: '$price' }, 
              sale: { $last: '$sale' }
          }
      }
  ], { allowDiskUse: true }).toArray()
  </code></pre>
  
  <p>But <code>sale</code> and <code>price</code> fields becomes <code>null</code>.
  I think, I should use <code>$project</code> before <code>$group</code>, how do I retain last document's value if current field is null?</p>