Details
-
Question
-
Resolution: Won't Do
-
Major - P3
-
None
-
None
-
Server Development Platform
-
Dev Tools 2019-05-20, Dev Tools 2019-06-03
Description
Semi-related to SERVER-40737, when inserting the min Date, Date(NumberLong("-9223372036854775808"), from the mongo shell it gets converted into ISODate("1970-01-01T00:00:00Z"). Is this intentional? I would expect it to error instead of silently converting the date.
MongoDB shell version v4.1.10-150-g8560239dba
|
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
|
Implicit session: session { "id" : UUID("5222ca7a-9585-45c2-a322-a8abe6b72791") }
|
MongoDB server version: 4.1.10-150-g8560239dba
|
PRIMARY> db.test.insertOne({date: new Date(NumberLong("-9223372036854775808"))})
|
{
|
"acknowledged" : true,
|
"insertedId" : ObjectId("5cba186bc1feb27106e4c8b5")
|
}
|
PRIMARY> db.test.find()
|
{ "_id" : ObjectId("5cba186bc1feb27106e4c8b5"), "date" : ISODate("1970-01-01T00:00:00Z") }
|
PRIMARY> new Date(NumberLong("-9223372036854775808"))
|
ISODate("0NaN-NaN-NaNTNaN:NaN:NaNZ")
|