Behavior:
mongos> db.test.insert(
)
mongos> db.test.find()
{ "_id" : ObjectId("50a410317d03635de69f66eb"), "t" :
}
mongos>
Reason:
Timestamps are stored as seconds, but the shell divides by 1000 on the way in and multiplies by 1000 on the way out.
Fix:
Change constructor to take first param as seconds, not millis, and error if the value is greater than the maximum unix time in seconds (seconds between 1970 and 2038).
- is related to
-
SERVER-8639 toJson produces incorrect shell TimeStamp constructor declaration
- Closed
- related to
-
SERVER-7437 jsonString does not handle Timestamps as documented
- Closed