I recently read in the mongoose docs that to get a stack trace from mongoose errors that includes details about which file the mongoose code was called from, you need to call .exec()?
Example:
I currently have a lot of code using this structure:
await collection.deleteMany({});
Do I need to add .exec() to get a more helpful stack trace?
await collection.deleteMany({}).exec();
If so, is there a global workaround, so I don't have to add .exec() a countless number of times?
References:
https://mongoosejs.com/docs/promises.html#should-you-use-exec-with-await https://github.com/Automattic/mongoose/issues/8747