This is the code not working.
Model.aggregate([{ "$match": query }]).explain(true);
Adding ,{ explain: true }
after the aggregation array into a MyModel.aggregate(array, options)
type of statement didn't work for me in Mongoose 5.2.7 / MongoDB 3.6.6. Luckily, MyModel.aggregate(array).explain()
is now available and documented https://mongoosejs.com/docs/api.html#aggregate_Aggregate-explain
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With