Anthony, http://wiki.apache.org/couchdb/ViewCollation is the way to accomplish tasks like that.
Christopher Lenz has a write-up of how to use view collation to sort views, achieving comments grouped by parent blog post. http://www.cmlenz.net/archives/2007/10/couchdb-joins In your case you could index a view with date and type, like this [type, date] and then if you had say 5 types you'd do 5 GET queries against the database, each one fetching only the documents for that day. View collation is one of my favorite things about CouchDB. I'm excited about reduce, because from what I understand, you could use it to lower this to 1 GET, if that's important to you. enjoy, Chris On Fri, Apr 25, 2008 at 9:34 PM, Anthony Mills <[EMAIL PROTECTED]> wrote: > I read most of the documentation, wiki and blogs, but I still do not see how > to accomplish a certain scenario. Hopefully I can describe it adiquitely. > > Lets say I have 1,000,000 documents [all of the same "type"] with a date > attribute. Lets say I want to pick a subset of those documents. How can I > pick those documents of one type that fall on one day? Will I need to get > all 1,000,000 documents? What if I want all documents of one type on one > day that match another attribute? > > I pretty sure this is what map/reduce will help with, but is there a way to > do this now? Can you use more documents to build date relations? > > Also, can you pass more variables than just key to the view function? > > Thank you, > > Anthony > -- Chris Anderson http://jchris.mfdz.com
