I'm getting errors like this after upgrading from mongodb node native driver 2.x to 3.x
Third parameter to find() must be a callback or undefined
I know what to do I just need to know what file this is in. How do I config the driver to show file / line when the error should appear?
Read this article - http://thecodebarbarian.com/using-monogram-to-upgrade-from-mongodb-node-driver-2-to-3.html
What you need to do is to add middleware that will throw exception and stacktrace
db.collection('Test').pre(/^(find|findOne)$/, action => {
const opts = action.params[1];
const allowedOptions = ['projection', 'sort', 'skip', 'limit', 'hint'];
if (opts != null &&
Object.keys(opts).find(option => !allowedOptions.includes(option))) {
throw new Error('MongoDB driver 3.x does not allow passing projection ' +
'as 2nd arg to find(). Use `projection` instead. Got ' +
require('util').inspect(opts));
}
});