Start a new topic

Save dates as BSON date type

I have been trying to save date objects in the BSON date format, but I always end up with a string. I tried using the $date key from this page: http://docs.mongodb.org/manual/reference/mongodb-extended-json/ but no joy.



My aim in doing this is to speed up search while finding documents inside date ranges. I am assuming that BSON date would be faster than string comparisons.



Any help would be much appreciated.
1 Comment

Hi, if you are using BL to create these dates, you should be able to simply use `new Date()` to create a native date object.
Login or Signup to post a comment