Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52ACF10ED6 for ; Tue, 16 Jul 2013 01:59:47 +0000 (UTC) Received: (qmail 41241 invoked by uid 500); 16 Jul 2013 01:59:46 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 41209 invoked by uid 500); 16 Jul 2013 01:59:46 -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 41201 invoked by uid 99); 16 Jul 2013 01:59:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jul 2013 01:59:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.214.178 as permitted sender) Received: from [209.85.214.178] (HELO mail-ob0-f178.google.com) (209.85.214.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jul 2013 01:59:41 +0000 Received: by mail-ob0-f178.google.com with SMTP id fb19so140795obc.23 for ; Mon, 15 Jul 2013 18:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=3HrLcJxTQ47c608YoSu9mXsCyGFN3Ik7i0mo97hqj0o=; b=D5GubM9U9Zcsmgyc79cdZil5NXtiCm197j4MPp0LgkuvBvUbr8fElrKTsu7f6S3618 DDwJLY5pHgG4HRZZxpozBt7CV6PtnRzUqjk36M2xr/yqNucAf9mvj309mmCPR8Wvqcrd 7ppZE3tv8+o2jt1KagjBA5/zDNsKjuQ+KIyidHn3CAfRObE+x7j2PNN+KnZo4nMPeyJn /jNnatwHsW3sy+AIjnBqNv3wlY+e5qCBH+OP0huYWBPY4Rg+xDJcmQYi33hrZdrejzJR ARe5fbDcLB6j3lhdHGHIgHWaO7e1bhxBum2XKdx2leRXH8bH2ddmbL/MQAW84mYx+Roi DvSg== X-Received: by 10.182.130.228 with SMTP id oh4mr45988153obb.38.1373939961195; Mon, 15 Jul 2013 18:59:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.121.104 with HTTP; Mon, 15 Jul 2013 18:58:40 -0700 (PDT) In-Reply-To: <51E4A829.3040507@bardubitzki.com> References: <51E47287.8070005@bardubitzki.com> <51E4A829.3040507@bardubitzki.com> From: Paul Davis Date: Mon, 15 Jul 2013 20:58:40 -0500 Message-ID: Subject: Re: startkey To: "user@couchdb.apache.org" Content-Type: multipart/alternative; boundary=089e0115ed2654740604e1975345 X-Virus-Checked: Checked by ClamAV on apache.org --089e0115ed2654740604e1975345 Content-Type: text/plain; charset=ISO-8859-1 Exactly like that yeah. On Mon, Jul 15, 2013 at 8:55 PM, Stephan Bardubitzki < stephan@bardubitzki.com> wrote: > Thanks for your response Paul. I think I'm missing something important. > How do I tell the view that I just need fr - language and not en, de, es ... > > startkey: ["fr", id, 0] ? > > > > On 13-07-15 03:26 PM, Paul Davis wrote: > >> You'll need to add an element to the key to emit the language. Pseudo >> code: >> >> for language in doc["languages"]: >> emit([language, doc.kml_id, doc.marker], 1) >> >> Also note that its generally not a good idea to emit the doc as the value. >> You should prefer to use include_docs=true in the query string. Emitting 1 >> allows you to specify "_sum" as a reduce function to get row counts for >> specific start/end key pairs. >> >> >> On Mon, Jul 15, 2013 at 5:07 PM, Stephan Bardubitzki < >> stephan@bardubitzki.com> wrote: >> >> Hi there, >>> >>> this map function >>> >>> "map": "function(doc) { if (doc.kml_id && doc.marker) { emit([doc.kml_id, >>> doc.marker], doc) } }" >>> >>> and this startkey >>> >>> startkey: [id, 0] --> sorting doc.marker >>> >>> let me retrieve data from a couch as needed. >>> >>> Now I got the task to add more languages beside English for description >>> properties in an array structure like this >>> >>> "language": [ >>> { >>> "en":{ >>> >>> } >>> }, >>> { >>> "fr": { >>> >>> } >>> } >>> ] >>> >>> I stuck in figuring out a startkey that let me retrieve the sorted data >>> only for a particular language. >>> >>> Any advice would be really appreciated. >>> >>> Thanks, >>> Stephan >>> >>> >>> ------------------------------**-- >> Spam/Virus scanning by CanIt Pro >> >> For more information see >> http://www.kgbinternet.com/**SpamFilter.htm >> >> To control your spam filter, log in at >> http://filter.kgbinternet.com >> >> > --089e0115ed2654740604e1975345--