我需要从 PouchDB 数据库中获取所有文档。谁能告诉我如何从回调函数中获取“文档”?我想将它作为响应对象返回,并在控制台输出中获取它。
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);
});
Run Code Online (Sandbox Code Playgroud)