Need a CouchDB trick to sort by date and filter by group
I have documents with fields ‘date’ and ‘group’. And this is my view:
What would be the equivalent query of this:
This simple solution is not coming into my head. 🙁
Pankaj, switch the order of the key you’re emitting to this:
Then you can pass in a start key and an end key when querying the view. It might be easier to do a separate query for each group that you want to pull data for. The data will be sorted by date.
I’m on my way out at the moment, but can elaborate more when I get back if it isn’t clear.