Mongoose: eachAsync not a function for aggregation cursor

Created on 5 Jul 2016  路  1Comment  路  Source: Automattic/mongoose

I have an aggregation like this:

var cursor = self.model('BwLog').aggregate([ ... ]).cursor({ batchSize: 50 }).exec();
cursor.eachAsync(function(doc) {
    do something...
})

I'm using Mongoose 4.5.3 and I'm getting an error:

cursor.eachAsync is not a function

The cursor from the aggregations is different from the query cursors? Do you plan to support this async method?

Regards,

Most helpful comment

Yeah right now aggregation cursors are completely separate. This would be a great feature to have though, thanks for the suggestion

>All comments

Yeah right now aggregation cursors are completely separate. This would be a great feature to have though, thanks for the suggestion

Was this page helpful?
0 / 5 - 0 ratings