-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I have an object that is stored in the database with millisecond precision:
"requested_at" : ISODate("2012-11-21T22:44:00.942Z")
When I write a query to find the next object with a greater date it fails:
Request.where(:requested_at.gt => r.requested_at).order_by(requested_at: :asc).limit(1).first
The object returned is the same as r that is used in the query. r presents itself as a DateTime and it either doesn't have ms precision or it is being ignored:
1.9.3-p194 :029 > r.requested_at.utc
=> Wed, 21 Nov 2012 22:44:00 +0000