I don't like relying on Date Mongo objects. I think Mongo is slower with 'date' objects than with other data types (like integers).
I usually use integers (if you need a time zone, you also have a tz field, then you have localized time):
document = {:some_timestamp => Time.now.to_i} @collection.find({'some_timestamp' => {'$gte' => Time.now.to_i}})
Sometimes I just use the timestamp built into BSON :: ObjectId's:
id = BSON::ObjectId.from_time(Time.now) @collection.find({'_id' => {'$lte' => id}})
source share