As a newcomer to JavaScript and pouchDB, I am encountering difficulties in fetching data from pouchDB
This problem is common when trying to retrieve and process data
db.allDocs({include_docs: true}).then(function (result) {
console.log(result.rows);
}));
However, my goal is to specifically return "result.rows"
var result = db.allDocs({include_docs: true}).then(function (result) {
return result.rows;
}));
Alternatively, I could simplify the output by utilizing the allDocs function without using .then
var result= db.allDocs({include_docs: true});
Although this method results in a more complex output
I came across a helpful link
which explains the concept of return when working with .then, however, it did not solve the issue with allDocs