Mongoose: Model.aggregate.then is not a function

Created on 5 Mar 2016  路  3Comments  路  Source: Automattic/mongoose

It seems the aggregate method on models is not thenable, is this intentional or an accidental omission?

new feature

Most helpful comment

Intentional. Use the .exec() function. We'll add a .then() that does this for you in a future release

All 3 comments

Intentional. Use the .exec() function. We'll add a .then() that does this for you in a future release

Ok that'd be great. I use the promises interface for all other Mongoose operations, so would be good if it can be consistent with aggregate as well. Thanks!

+1

Was this page helpful?
0 / 5 - 0 ratings