Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 94287 invoked from network); 1 Oct 2008 17:05:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Oct 2008 17:05:24 -0000 Received: (qmail 47652 invoked by uid 500); 1 Oct 2008 17:05:20 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 47577 invoked by uid 500); 1 Oct 2008 17:05:20 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 47532 invoked by uid 99); 1 Oct 2008 17:05:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2008 10:05:20 -0700 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=DNS_FROM_RFC_BOGUSMX,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ben@groovie.org designates 85.10.207.234 as permitted sender) Received: from [85.10.207.234] (HELO unicron.groovie.org) (85.10.207.234) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2008 17:04:17 +0000 Received: from c-71-202-164-208.hsd1.ca.comcast.net ([71.202.164.208] helo=Shaggy.home.groovie.org) by unicron.groovie.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1Kl550-00076b-Ub for couchdb-user@incubator.apache.org; Wed, 01 Oct 2008 10:01:40 -0700 Message-Id: <5152C024-ACC0-4FF7-AB45-171C0B2311EC@groovie.org> From: Ben Bangert To: couchdb-user@incubator.apache.org In-Reply-To: Content-Type: multipart/signed; boundary=Apple-Mail-17--239844432; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: Associating users and comments Date: Wed, 1 Oct 2008 10:01:31 -0700 References: <2098F155-ECB7-468E-8CA7-8E54F18EE606@groovie.org> X-Mailer: Apple Mail (2.929.2) X-Spam-Score: -2.6 (--) X-Spam-Report: Spam detection software, running on the system "unicron.groovie.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sep 30, 2008, at 7:26 PM, Paul Davis wrote: > 1. To prevent the need to re-update all your sub-records, use a > uniquely identifying piece of data that doesn't change. Ie, use the > user docid instead of slug. This prevents you from being able to > display a post without fetching the user doc, but getting the whole > shebang in one get should alleviate that. (as was the original > intent). [...] Content analysis details: (-2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 DNS_FROM_RFC_BOGUSMX RBL: Envelope sender in bogusmx.rfc-ignorant.org -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 0.3 AWL AWL: From: address is in the auto white-list X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-17--239844432 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Sep 30, 2008, at 7:26 PM, Paul Davis wrote: > 1. To prevent the need to re-update all your sub-records, use a > uniquely identifying piece of data that doesn't change. Ie, use the > user docid instead of slug. This prevents you from being able to > display a post without fetching the user doc, but getting the whole > shebang in one get should alleviate that. (as was the original > intent). Yes, I was planning on having comments reference the CouchDB assigned ID of the user, as well as the ID of the document its commenting on. While I understand that somehow a map/reduce will help me assemble this information, the lack of examples and docs on what exactly is going on is making it difficult to see how I'd actually write it. > 2. You're right that you the view count only gives you that many rows, > regardless of what type. For the first "Give me back 5 customers with > their orders" I'd do a reduce with group_level=1 and sum the rows, > then a second get to get that many rows from the view. The second > question about getting the latest 5 orders for each customer would > require a different view probably. I have the feeling it should be > doable with a clever emit, but I'm a bit tired so its not > materializing. I haven't seen any map/reduce examples that do such combinations of data. Does anyone have some pointers to map/reduce examples that return data mingled together like this? Cheers, Ben --Apple-Mail-17--239844432 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGfTCCAzYw ggKfoAMCAQICEClzcfApE1Xl0tE8fQf6InIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA4MDUyMzIyMDUzNVoXDTA5MDUyMzIyMDUz NVowZjEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEjMCEGCSqGSIb3DQEJARYUYmJh bmdlcnRAZ3Jvb3ZpZS5vcmcxHjAcBgkqhkiG9w0BCQEWD2JlbkBncm9vdmllLm9yZzCCASIwDQYJ KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMAxyJSHPp0a6b6jg37ULZHv6Vh+ZthZh0LIACrEkeDU KT2Gop2+h7wuoZNRSOLGSijSuMmYL9whUZmDLefzwkU8/yL7Ya6dh+QE3L0TM2nGqhF1v6/uzQaN cYukSeWkRMx2QrRGpu5npDWUsMN8vKMziDlVpjpQKDfnupVFa34vhWpavJliaDh4KbPBBfesR3Xg wEdgwOmhfL/lgDNdO8SHtZ3+s/ysf095eM5b2IP+kLyF2t/NOFTA3zIWbjOAIGyyxyt7J2x1oEAT 1VlATLQ0+DQhh4UZS/PIJpJsOGxttjfqKTTbXivBDDUEq843wz4L0X5YZlv4ky8vAj1bolsCAwEA AaNlMGMwDgYDVR0PAQH/BAQDAgP4MBEGCWCGSAGG+EIBAQQEAwIFIDAwBgNVHREEKTAngRRiYmFu Z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