PouchDB查询映射 - 查找最高值

时间:2015-12-22 15:02:52

标签: javascript pouchdb

如何找到字段x

值最高的文档
map = function(doc) {
  // here, how do I emit the document with the highest value of 'doc.x'?
}

db.query(map, {include_docs: true}).then(function(doc) {
    console.log(doc.x)
})

1 个答案:

答案 0 :(得分:0)

这可能不是最好的方法,但这就是我做的方式:

restivus
相关问题