incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aurélien Bénel <aurelien.be...@utt.fr>
Subject Re: Sorting dates in CouchDB
Date Mon, 08 Oct 2012 09:35:21 GMT
> have a bunch of documents stored in Couch with expiry dates like this: "expire": "2020-07-28T15:13:00+00:00"
> (...)
> I'm then querying the data ranges like this: ?startkey="2012-10-02"&endkey="2012-12-02"

You can do that, but be aware that you're comparing strings of different lengths.
One consequence is that you won't get timestamps from 2012-12-02.

This is because of the following alphabetical order:
2012-10-01T8:00:00+00:00
2012-10-02
2012-10-02T9:00:00+00:00
2012-12-01T10:00:00+00:00
2012-12-02
2012-12-02T11:00:00+00:00


Regards,

Aurélien
 


Mime
View raw message