Also, getting this featured into 1.3 would eliminate the need to make a request for each group:
https://issues.apache.org/jira/browse/COUCHDB-523 On Friday, April 13, 2012, Robert Newson wrote: > Firstly, there's often not a translation as CouchDB is not a > relational database. In this case, you can get much of the way; > > emit([doc.group, doc.date], null); > > then query with ?startkey=["group1"]&endkey=["group1",{}]. This > selects all rows where doc.group equals "group1", in date order as > ["group1"] is equal or lower than any possible two element array where > the first element equals "group1" and ["group1",{}] is greater than > any two element array where the second element is any string or number > (as objects sort higher). > > B. > > On 13 April 2012 16:02, Pankaj Jangid <[email protected]<javascript:;>> > wrote: > > Hi, > > > > I have documents with fields 'date' and 'group'. And this is my view: > > > > byDateGroup: { > > map: function(doc) { > > if (doc.date && doc.group) { > > emit([doc.date, doc.group], null); > > } > > } > > } > > > > What would be the equivalent query of this: > > > > select * from docs where group in ("group1", "group2") order by date desc > > > > > > -- > > > > Thanks and regards > > > > Pankaj >
