Thaina Yu created COUCHDB-3321:
----------------------------------
Summary: group_level=docid
Key: COUCHDB-3321
URL: https://issues.apache.org/jira/browse/COUCHDB-3321
Project: CouchDB
Issue Type: Improvement
Components: HTTP Interface, JavaScript View Server
Reporter: Thaina Yu
I think it would be useful for include_docs=true on mapreduce view if we could
group by DocID before returning document content
Suppose we have document that relate to multiple user
doc1 : { users : ["a","b"] , content : { bigData } }
doc2 : { users : ["b","c"] , content : { bigData } }
doc3 : { users : ["a","c"] , content : { bigData } }
doc4 : { users : ["a","b","c"] , content : { bigData } }
So we emit view each row for each user
{ doc : "doc1" , key : "a" }
{ doc : "doc3" , key : "a" }
{ doc : "doc4" , key : "a" }
{ doc : "doc1" , key : "b" }
{ doc : "doc2" , key : "b" }
{ doc : "doc4" , key : "b" }
{ doc : "doc2" , key : "c" }
{ doc : "doc3" , key : "c" }
{ doc : "doc4" , key : "c" }
And then we query document of a and b
_design/MyDesign/_view/MyView?include_docs=true&keys=["a","b"]
It will return double doc1 which is unnecessary
I wish we could specify group_level=docid so it will group value with document
and return only one unique document
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)