couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Wolff <awo...@gmail.com>
Subject Re: MultiKey sorting in views
Date Tue, 13 Apr 2010 04:27:39 GMT
This isn't easy to handle in couch. Your best bet is to sort client-side if
possible.

A

On Mon, Apr 12, 2010 at 9:03 PM, Pavan Kumar <tvpavan@gmail.com> wrote:

> Hi,
>
>  I have documents with author and submitted time ( utc value of date )
> fields . Now i need to sort descending ( i.e latest first ) on time and
> filter by author in a view.
>
> I tried a few things like given below but they don't work. My "view"
> knowledge needs lot of catching up.. Any pointers would help..
>
> 1) Filters by author but doesn't sort by time
>
> startkey: [ author , 0 ]
> endkey : [ author, now ]
> descending : true
>
> Map:
> emit([doc.author,doc.submit_at],doc )
>
>
> 2) Doesn't filter by author !! :(
>
> startkey: [ 0 , author ]
> endkey : [ now, author ]
> descending : true
>
> Map: emit([doc.submit_at,doc.author],doc )
>
> regards,
> Pavan
>

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