title: TypeError: db.collection(...).aggregate(...).cursor is not a function when querying Mongo in batches
body: <p>I have a pretty large Mongo collection which I want to query in batches of 50K docs using a cursor with a pre-defined batchSize.</p>
  <p>This is my code-</p>
  <pre><code>const aggregation = [{ $match: { example: '1' }}]
  
  await mongoose.connect(CONNECTION_STRING)
  const db = mongoose.connection
  db.collection('some-collection')
      .aggregate(aggregation)
      .cursor({ batchSize: 50000 })
      .exec()
  
  await cursor.eachAsync(async (doc) =&gt; {
    // do something
  })
  </code></pre>
  <p>For some reason I keep getting the following error -</p>
  <pre><code>TypeError: db.collection(...).aggregate(...).cursor is not a function
  </code></pre>
  <p>What am I doing wrong? Is there any other way to query Mongo in batches?</p>