mongoose sum a value across all documents
<p>I am looking to count all columns with the name amount in the documents that match my query,</p>

<pre><code> tickets.count({time: {$gte: a}, time: {$lte: tomorrow}}).then(function (numTickets) {
</code></pre>

<p>How can I get the total result of the document column called amount?</p>

<p>Example, if I do have:</p>

<pre><code>{ time: 20, amount: 40}
{ time: 40, amount: 20}
</code></pre>

<p>it would return the total amount(60)?</p>

<p>Remember that I do need to use <code>{time: {$gte: a}, time: {$lte: tomorrow}</code> in the query.</p>

<p>How would I do this?</p>