As you know from 2.6 on Mongodb aggregate()
operation returns a cursor, however the behavior is a bit different than the normal cursor which returns from a find()
. I am using native mongodb nodejs driver, and could not find a proper documentation on available aggregate cursor methods.
For example, one cannot run a count()
on an aggregation cursor however there are two methods such cursor.objsLeftInBatch()
and cursor.itcount()
n mongo shell. I could not find any of them in the source code of nodejs native driver. What aggregation cursor methods are supported by Nodejs native driver or Mongoose?