小编Raj*_*aul的帖子

pouchdb - 从数据库中获取所有数据

我需要从 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)

cloudant pouchdb

4
推荐指数
1
解决办法
6852
查看次数

标签 统计

cloudant ×1

pouchdb ×1