I received a http response using nano couchdbDB but cannot use .pipe to convert the received data into what actually comes.
myservice.service.ts
export class xx{
public mycall(docid: string = ''){
return nanoInterface.db
.use('mydatabase')
.get(docid) //cannot use.pipe() after this (it does not have)
}
}
mycontroller.controller.ts
....
public getdoc = (doc) => {
this.xx.mycall(doc)
.then(results => { //type nano.DocumentGetResponse
console.log(results); // { _id:"xx",prop1:"xx", prop2:"xx" }
const { _id,prop1, prop2 } = results; //works but TS gives warning: Property 'prop1' does not exist on type 'DocumentGetResponse'.ts(2339)
const y = results.prop1; // TS gives the warning
...
})
.catch(error => {
...
});
How i can access to the properties of the response object without the TS warnings? Thank you.