Open
Description
Currently, ComplexDateTimeField is not useable as a TTL index. Right now, this is stored as a simple string to enable lexicographic comparison but MongoDB itself won't be able to use it for a TTL index. I think changing the storage to an array will do the trick:
[ISODate, microsecond] # zero out seconds/milliseconds in ISODate
This should sort properly and work with MongoDB TTL indexes per the documentation:
http://docs.mongodb.org/manual/core/index-ttl/
Backwards compatibility can be maintained by just converting data on egress to DB.
Thoughts? If everyone agrees this would be a good course, I can work on the PR.