[
https://issues.apache.org/jira/browse/COUCHDB-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15904764#comment-15904764
]
Thaina Yu commented on COUCHDB-3321:
------------------------------------
Well, sure we could use query or search feature. But mapreduce view is more
useful in some case. So just enable this feature make it more performance
> 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
> {code:javascript}
> 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 } }
> {code}
> So we emit view each row for each user
> {code:javascript}
> { 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" }
> {code}
> And then we query document of a and b
> {code}
> _design/MyDesign/_view/MyView?include_docs=true&keys=a,b
> {code}
> It will return duplicate of 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)