Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 53549 invoked from network); 26 Dec 2009 14:05:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Dec 2009 14:05:55 -0000 Received: (qmail 60562 invoked by uid 500); 26 Dec 2009 14:05:54 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 60478 invoked by uid 500); 26 Dec 2009 14:05:53 -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 Received: (qmail 60468 invoked by uid 99); 26 Dec 2009 14:05:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Dec 2009 14:05:53 +0000 X-ASF-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.219.216] (HELO mail-ew0-f216.google.com) (209.85.219.216) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Dec 2009 14:05:44 +0000 Received: by ewy8 with SMTP id 8so7228847ewy.35 for ; Sat, 26 Dec 2009 06:05:23 -0800 (PST) MIME-Version: 1.0 Sender: mark@testing-software.org Received: by 10.216.89.80 with SMTP id b58mr4693510wef.73.1261836323132; Sat, 26 Dec 2009 06:05:23 -0800 (PST) X-Originating-IP: [84.155.212.227] Date: Sat, 26 Dec 2009 15:05:23 +0100 X-Google-Sender-Auth: e0a4a44765ebdf5f Message-ID: Subject: some guidance for couchdb views From: Fink Mark To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e6dab034ce1584047ba22918 --0016e6dab034ce1584047ba22918 Content-Type: text/plain; charset=ISO-8859-1 Hi there, I am new to couchdb and currently stuck with the sample app I am working on. I managed to put some data into couchdb, for example: File CountLineCode SumCyclomatic RatioCommentToCode content/events/src/nsQueryContentEventHandler.cpp 432 226 0.12 content/events/src/nsXMLEventsElement.cpp 47 11 0.79 content/events/src/nsXMLEventsManager.cpp 352 94 0.15 content/html/content/src/nsClientRect.cpp 82 35 0.48 content/html/content/src/nsFormSubmission.cpp 813 187 0.49 content/html/content/src/nsGenericHTMLElement.cpp 2652 646 0.13 content/html/content/src/nsHTMLAnchorElement.cpp 456 132 0.18 content/html/content/src/nsHTMLAreaElement.cpp 365 101 0.16 content/html/content/src/nsHTMLAudioElement.cpp 43 26 1.02 (every row is put into its own document) Now I want to query the datastore using map/reduce views. The reduce function should add the values for a given key (keys are part of the file value). For example a query for "content/html/content/src/nsFormSubmission.cpp" would result into "CountLineCode": 813, "SumCyclomatic": 187, "RatioCommentToCode": 0.4. A query for "content/html/" would add the values where File matches the given prefix. "content/" would add more and "" would add the values of all documents. I feel that this is exactly what couchdb is good at and I think there is a very simple solution to this. Unfortunately I do not have much practise with the map reduce functions and I need some help. Maybe there is tutorial available to help with similar path oriented views? Maybe I got it all wrong and should put all the lines above into one single document. I had this before but futon stopped working nicely because the document had about 5000 lines. I think in this scenario I could not even apply the map reduce functions. I have to traverse the document by myself. What do you think? regards, Mark --0016e6dab034ce1584047ba22918--