I am using a async await to make a db call
let result = await cb.addDoc(req.bucket,docKey,newContact)
the function i call is a promise and works fine but i am having an issue accessing the second part of resolve. my result is always the docId. How can i get access to to the result in resolver ?
const addDoc = (bucket,docID,doc)=>{
return new Promise((resolve,reject)=>{
bucket.insert(docID,doc,(err, result)=>{
if(err) return reject(err);
return resolve(docID ,result);
});
});
}