couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willison <>
Subject Is it possible to produce counts with a reduce function, then order by those counts?
Date Wed, 02 Dec 2009 17:18:49 GMT

I've just started learning CouchDB, so apologies if this is covered in
an FAQ (I've looked around a bit and haven't found it though).

I'd like to write a view which counts the number of occurrences of a
value across my whole document set, then returns those occurrences
ordered by their frequency.

Essentially this:

But with an "order by count" at the end.

Is this possible, or am I asking the wrong kind of question?


Simon Willison
Please consider the environment before printing this email.
Visit - the UK's most popular newspaper website

To save up to 33% when you subscribe to the Guardian and the Observer visit


This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.

Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.

Guardian News & Media Limited
A member of Guardian Media Group PLC
Registered Office
Number 1 Scott Place, Manchester M3 3GG
Registered in England Number 908396

View raw message