I recommend using the MongoDB native date format. The advantage of that is that you can then easily use the date operators: http://docs.mongodb.org/manual/reference/operator/aggregation-date/
Store/Index time in mongo, use a timestamp or a date/time
-
26-06-2023 - |
题
When storing a timestamp in mongodb should I store the 'unix-time' millis since some date or should I store an actual date/time?
What are the benefits of either?
Edit
To be more specific should I store a long that is seconds since Jan 1. 1970, or should I store a Javascript date object.
解决方案
不隶属于 StackOverflow