async await callback is not a function

Viewed 10952

I am using couchbase ottaman package:

let transaction = new Transaction({name:'Couch'});
    transaction.save((err) => {
        console.log(err);
    });

but can I use async/await with this package?

async create(){
        let transaction = new Transaction({name:'Couch'});
        try{
            await transaction.save();
        } catch (err) {
            console.log(err);
        }
    }

I am getting error:

node_modules\ottoman\lib\modelinstance.js:457
            callback(err);
            ^

TypeError: callback is not a function
1 Answers
Related