incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ishi soichi <>
Subject view ordered by DateTime
Date Fri, 04 Jan 2013 10:30:26 GMT
couchdb latest
python 2.7
ruby 1.9.3

I have a database obtained from Twitter.
Each tweet contains the information about when it's created, namely,

The problem is if I try to view them with the function

function(doc) {
  if (doc['created_at'] != null) {
    emit(doc['created_at'], doc['text']);

the tweets are ordered ALPHABETICALLY, not by datetime.

This is because the data is stored in couchdb in the form of String rather
than DateTime object.

How can I order the outputs by DateTime?

I can program in JavaScript, Ruby(couchrest), and Python, I appreciate
concrete example using any of these languages.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message