incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bryan rasmussen <rasmussen.br...@gmail.com>
Subject advice on how to get equal number of items of different types from db
Date Fri, 09 Dec 2011 09:01:08 GMT
Hi,

I have a db where items in the db are of different types, lets say
type A, B, and C.
There are a lot of items in the db, and I am returning 60 at a time in
my view. I could theoretically end up in a situation where my first
1000+ results are of type A when what I want  is an even mix of type
A,B and C.

I could of course do a view for each type but this is problematic in
that my view is called at the application's load via Ajax, and I don't
want to send off 3 requests at that time.

So what I want is a view or mapreduce or other Couchdb functionality
that allows me to return a mix of my types?

Any pointers, suggestions?

Thanks,
Bryan Rasmussen

Mime
View raw message