MongoError: The ‘cursor’ option is required, except for aggregate with the explain argument

Thanks @Neil Lunn Update mongoose. Mongoose versions prior to 5.0 are incorrectly matched for MongoDB 3.6. MongoDB 3.6 changed the aggregate API from “cursor optional” to “cursor only”, and older mongoose versions break this by trying to invoke a deprecated way to ask for an array in response.

Aggregate $lookup Total size of documents in matching pipeline exceeds maximum document size

As stated earlier in comment, the error occurs because when performing the $lookup which by default produces a target “array” within the parent document from the results of the foreign collection, the total size of documents selected for that array causes the parent to exceed the 16MB BSON Limit. The counter for this is to … Read more