如何使用couchdb python调用具有键列表的视图?

如何使用couchdb python调用具有键列表的视图?,python,couchdb,couchdb-python,Python,Couchdb,Couchdb Python,我有一个视图定义: """ Models id.""" models = ViewDefinition('models', 'by_authors', """ function(doc) { if (doc.type == "definition") { for (var i = 0; i < doc.authors.length; i++) { var author = doc.authors[i]; emit(author, doc._id);

我有一个
视图定义

""" Models id."""
models = ViewDefinition('models', 'by_authors', """
function(doc) {
  if (doc.type == "definition") {
    for (var i = 0; i < doc.authors.length; i++) {
      var author = doc.authors[i];
      emit(author, doc._id);
    }
  }
}""")
我怎样才能要求一个密钥列表,并将其称为:

models = [d.value for d in views.models(self._db)[*principals].rows]

这个解决方案非常简单,而且我必须阅读源代码才能找到它

models = [d.value for d in views.models(self._db, keys=principals).rows]
models = [d.value for d in views.models(self._db, keys=principals).rows]