couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hahn <m...@hahnca.com>
Subject Re: how to fetch the newes document of every type?
Date Fri, 26 Oct 2012 21:05:06 GMT
> but i want exactly one of a kind,

Emit the type as the key and the date as the value.  Then do a map-reduce
to keep the latest of each type using the max function.

On Fri, Oct 26, 2012 at 2:01 PM, Dirk Heilig <dirk@heilig-online.com> wrote:

> i've already thought about that, bis in my example, ill might get the
> result:
>
> 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 <jens@couchbase.com>:
> >
> > On Oct 26, 2012, at 12:48 PM, Dirk Heilig <dirk@heilig-online.com>
> 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 ‘created’ property as the key. Then query the view in
> descending order with a limit.
> >
> > —Jens
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message