title: Why am I getting a AggregationCursor as a result and not an average?
body: <p>I'm querying my MongoDB database and don't understand why I am getting an aggregator cursor as a result when I expect to be returned a single number. Maybe I need to get something from the cursor object? Just can't figure out what. </p>
  
  <pre><code>module.exports = CalculateAvg = async collection =&gt; {
  try {
    // const count = await collection.countDocuments({ word: "Hello" });
    // console.log(count) // logs 140, which shows that it is accessing the db correctly
    const cursor = await collection.aggregate([
      { $match: { word: "Hello" } },
      {
        $group: {
          _id: null,
          mean: {
            $avg: "$value" // in the dataset, each doc has a value field which equals a number
          }
        }
      }
    ]);
    console.log(cursor) // logs a large AggregationCursor object, rather than a number
  } catch (err) {
    console.log(err);
  }
    };
  </code></pre>