Pregunta

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.

¿Fue útil?

Solución

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/

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top