I need to get all the documents from PouchDB database . Can anyone tell me how to get the 'doc' from the callback function? I would like to return it as response object and also to get it in console output.
var db = new pouchdb('meetups');
db.allDocs({
include_docs: true,
attachments: true
}).then(function (err,res) {
console.log("Result..."+res);
res.json({'users':res});
}).catch(function (err) {
console.log(err);
});