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 1AEE4991B for ; Fri, 26 Oct 2012 21:07:46 +0000 (UTC) Received: (qmail 46361 invoked by uid 500); 26 Oct 2012 21:07:44 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 46324 invoked by uid 500); 26 Oct 2012 21:07:44 -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 46315 invoked by uid 99); 26 Oct 2012 21:07:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2012 21:07:44 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ryan.ramage@gmail.com designates 74.125.83.52 as permitted sender) Received: from [74.125.83.52] (HELO mail-ee0-f52.google.com) (74.125.83.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2012 21:07:38 +0000 Received: by mail-ee0-f52.google.com with SMTP id b57so1265861eek.11 for ; Fri, 26 Oct 2012 14:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=FFytR2ODaUxMCUWG07r2j24maGawSrxtlkdwOiEyHNU=; b=Jgcyup62bPO4c0IU78JE1rfwbHomY552cTK7HS9m5q7qFR1G3Q9KQfNFWTiGy+Ti4L LT33VfoBa1TSlIqff9r867A/Gne2FMpsGLvw9vGuYHgWENv96Zw5ij0RYjGdWOkTibsI s1D4Gl7/4A5NOYnJ6MLze6BSAqHarG+orGZwiY6W3GZkQU6CUt9RI8alHiHUXzb/gVbx pAo/pjs76JsJM0wsoN9kV5Lyf2Rf0FVG+1yg/OdQGPO/09wf411DS72ibc00xzJ2dxQB moh0HLn5gNekB5+WJ0YYfxuxjB43YavW1jYoXkzfjlE6R4mLCAf6BgqhrPVmydLsBJGD OFcw== MIME-Version: 1.0 Received: by 10.14.173.67 with SMTP id u43mr36466714eel.27.1351285638606; Fri, 26 Oct 2012 14:07:18 -0700 (PDT) Received: by 10.14.188.132 with HTTP; Fri, 26 Oct 2012 14:07:18 -0700 (PDT) In-Reply-To: References: <4A95B65F-0EC8-45EE-B91C-72D3C2B62FA3@couchbase.com> Date: Fri, 26 Oct 2012 15:07:18 -0600 Message-ID: Subject: Re: how to fetch the newes document of every type? From: Ryan Ramage To: user@couchdb.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org function map(doc) { emit(['all', doc.created], doc.headline) emit([doc.news_type, doc.created], doc.headline) } ddoc/_view/by_type?start_key=3D["world",{}]&end_key=3D["world"]&descending= =3Dtrue&limit=3D20 ddoc/_view/by_type?start_key=3D["all",{}]&end_key=3D["all"]&descending=3Dtr= ue&limit=3D20 On Fri, Oct 26, 2012 at 3:01 PM, Dirk Heilig wrote= : > i've already thought about that, bis in my example, ill might get the res= ult: > > world-news from yesterday > world-news from 2 days ago > sports-news from last weekend > > > but i want exacly one of a kind, not the last 3 once > > 2012/10/26 Jens Alfke : >> >> On Oct 26, 2012, at 12:48 PM, Dirk Heilig wrote= : >> >>> what i need is a view, and the magic wat to query this view to get the >>> lastest news of any kind, how do i manage this? >> >> Emit the =91created=92 property as the key. Then query the view in desce= nding order with a limit. >> >> =97Jens