I'm running an aggregation on a collection of around 300k+ records which requires several unwinds and regroups. I'm hitting the following error;
'exception: Exceeded memory limit for $group, but didn\'t allow external sort. Pass allowDiskUse:true to opt in.'
I can't seem to work out how to pass this option through using the mongoose.js API?