1) "new Date ()" in the mongo shell gets the status of ISODate (), so you can use the following methods:
> new Date(1330828762699) ISODate("2012-03-04T02:39:22.699Z") > new Date(1330828762699).getMilliseconds() 699
2) Regarding timestamps on documents, do you know that you can use the built-in creation date?
> ObjectId("5020317b92c3d21cb851fa1a").getTimestamp() ISODate("2012-08-06T21:04:59Z")
3) I would like to take a look at the overall 2.2 framework for managing your data. It has some useful date functions that you can use to create useful time queries for your data;
http://docs.mongodb.org/manual/reference/aggregation/#date-operators
source share