I am using a static Model method and need a function within it to act synchronously. I installed the babel-plugin-transform-async-to-generator
npm package, but get the warning:
await is a reserved word
Here is the static method:
SomeSchema.statics.doSomething = async function(data, callback) {
...
this.model('Template').findById(id, function (err, doc) {
let ref = await getNextSequence();
...
});
...
};