Created
May 18, 2011 09:55
-
-
Save jlecour/978307 to your computer and use it in GitHub Desktop.
How MongoDB (Ruby driver) handle Date/DateTime/Time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> coll.insert({:date => Date.today}) | |
BSON::InvalidDocument: Date is not currently supported; use a UTC Time instance instead. | |
>> coll.insert({:date => DateTime.now}) | |
BSON::InvalidDocument: DateTime is not currently supported; use a UTC Time instance instead. | |
>> coll.insert({:date => Time.now}) #=> BSON::ObjectId('4dd39768b98f703261000003') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just more ideas to handle this, taking last post as reference, thanks
a function to parse all elements into hash with word "date" in it key, ex: startdate, enddate, created_at_date, etc. Element with format mm/dd/yyyy