Вопрос

Is there a way in CouchDB to make a master/detail _view or _list?

From the other hand it looks like _view is only able to render a master and _list is only able to render a list of detail. So the answer could be proofed by a link that confirms that it is impossible.

Это было полезно?

Решение

Use view collation to gather details:

function(doc) {
  if (doc.type == "post") {
    emit([doc._id, 0], doc);
  } else if (doc.type == "comment") {
    emit([doc.post_id, 1], doc);
  }
}

and query with ?key=<post_id>

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top