couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes J. Schmidt" <schm...@netzmerk.com>
Subject Re: Views, lookup by a key, then sort by another one?
Date Thu, 06 Jan 2011 15:21:58 GMT
You could query with

startkey=["developers",null]&endkey=["developers",{}]

to get all developer documents.

Greetings
Johannes

Am Donnerstag, den 06.01.2011, 23:11 +0800 schrieb He Shiming:
> > 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"]
> >
> 
> Hi Martin. A quick follow up. It looks like this won't work. When I
> specify key=["developers"] with emit ([doc.user_group,
> doc.updated_at], doc.type) , it emitted nothing. The output is like
> this:
> 
> {"total_rows":100,"offset":0,"rows":[]}
> 
> There are 100 rows passed the "if" check and that number is correct.
> Are there any typos in the syntax or am I doing something wrong?
> 

-- 
Netzmerk GbR
Johannes J. Schmidt

http://netzmerk.com
01525 378 65 21

Am Vierstückenpfuhl 3a
14167 Berlin

Mime
View raw message