couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From He Shiming <heshim...@gmail.com>
Subject Views, lookup by a key, then sort by another one?
Date Thu, 06 Jan 2011 12:56:13 GMT
Dear CouchDB Community,

I've got some documents like this:
{
  "type": "user",
  "user_group": "developers",
  "updated_at": "2011-01-04T20:20:20Z"
  ...
}

And I've got a simple map function to lookup documents by "user_group" field:
function(doc) {
  if (doc.type == "user" && doc.user_group) {
    emit(doc.user_group, doc.type);
  }
}

My question is, how do I sort the result by the "updated_at" field? If
possible, how do I specify a date range? Thanks!

-- 
Best regards,
He Shiming

Mime
View raw message