Indexing a date field on MongoDB - best practice Hi We would like to index a date field on a potentially large collection.
Is indexing a date-time field a good practice? Or should we stick to a date field (e.g. 07/12/2017) indexing (both of the options are valid as candidates for our date field, of course the date time is more fit if there is no real impact on performance)
In MongoDB dates are stored as BSON Dates and this type is a 64-bit integer that represents the number of milliseconds since the Unix epoch (Jan 1, 1970). This means that dates and date-time values are stored in the same format, so there is no difference in indexing on either of them.