couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From He Shiming <heshim...@gmail.com>
Subject Re: Views, lookup by a key, then sort by another one?
Date Thu, 06 Jan 2011 14:56:19 GMT
> To sort by date you should emit( [doc.user_group, doc.updated_at], doc.type)
> - however documents will still be sorted by user group first.
>
> With such keys you query a perticular date range by providing, for instance,
> startkey=["developers",2011-01-04]&endkey=["developers",2011-02-04]
> (url-encoded)
>
> You will still be able to do simple queries like : key=["developers"]
>
> If you need to filter documents with updated_at only, another view where
> updated_at is the single key is a better option.
>
>
> Martin
>

Many thanks, this is just what I'm looking for.

-- 
Best regards,
He Shiming

Mime
View raw message