Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 23938 invoked from network); 23 Jun 2009 16:14:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Jun 2009 16:14:05 -0000 Received: (qmail 63429 invoked by uid 500); 23 Jun 2009 16:14:15 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 63343 invoked by uid 500); 23 Jun 2009 16:14:15 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Delivered-To: moderator for user@couchdb.apache.org Received: (qmail 486 invoked by uid 99); 19 Jun 2009 03:51:05 -0000 X-ASF-Spam-Status: No, hits=-1.8 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of ncohen@ucsd.edu) Message-Id: <917C76EE-2941-4477-89D6-42B5C8572D05@ucsd.edu> From: Ben Cohen To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=Apple-Mail-352-788198007 Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Fwd: 'Grouping' documents so that a set of documents is passed to the view function Date: Fri, 19 Jun 2009 11:49:30 +0800 References: <8FDAC300-76A7-47FE-B4ED-6629894936CC@gmail.com> X-Mailer: Apple Mail (2.930.3) X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on sdsioa.ucsd.edu X-Spam-Level: X-Spam-Report: * 0.1 HTML_MESSAGE BODY: HTML included in message * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Virus-Scanned: by AMaViS 0.3.12 X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=-4.8 required=4.0 tests=BAYES_00,HTML_MESSAGE autolearn=ham version=2.63 --Apple-Mail-352-788198007 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Big apologies for spamming the list -- I accidentally sent this email rather than another. Cheers, Ben Begin forwarded message: > From: Ben Cohen > Date: June 19, 2009 11:48:22 AM GMT+08:00 > To: user@couchdb.apache.org > Subject: 'Grouping' documents so that a set of documents is passed > to the view function > > Is there anyway, or any known plan to add a way, to arrange for > couchdb to pass multiple documents to a view function rather than > just a single doc? > > I've got an application where for a variety of reasons I cannot > control the update method that various information sources use to > get data into couchdb. This has the effect of breaking up > information I would like to treat as a single document across a > 'small' number (say 100) documents. I'd like to define some way for > the 'relationship' between these documents to be 'discovered' by > couchdb so that those 100ish documents are passed to my view > function all at once. > > eg say i have the documents: > > { > "_id" : "doc_a", > "data" : "doc_a_data", > "group_key" : 1 > }, > { > "_id": "doc_b", > "data": "doc_b_data", > "group_key" : 1 > } > { > "_id": "doc_c", > "data": "doc_c_data", > "group_key" : 2 > } > { > "_id": "doc_d", > "data": "doc_d_data", > "group_key" : 2 > } > > It would be really cool if there were some way to pass all the docs > with a value of 1 for group_key to a single map function call, so I > could do computation across those related documents and emit the > results ... I'm just using the magic group_key attribute as an > example, if such a feature were to actually be made I'd think you'd > define a javascript function which returned a single groupping k to > exist I --Apple-Mail-352-788198007--