Update ISODate() resulted in random number

Hi ,

I tried to update by setting year as 2999 in ISODate() but after update value is getting converted to date and with random number as below.

Update command:-

db.products.update(
{ _id: 1 }, { “dateAdded” : ISODate(“2999-01-18T06:59:47.371Z”)
}, { upsert: true })

Results after querying :

{"_id": 1.0,

“dateAdded”: Date(32473637987371)

}

Actual results should be :

db.products.update( { _id: 1 },
{
“dateAdded” : ISODate(“2018-01-18T06:59:47.371Z”)
},
{ upsert: true })

Hence it is not working for 2999 but working for 2018 can anyone help me please in this regards.

Thanks,
Vishwanath

I am able to modify the date just fine.

`MongoDB Enterprise mflix-shard-0:PRIMARY> db.test.update({_id:ObjectId(“5c447282b5c23724aa3b30ec”)},{date:ISODate(“2999-01-18T06:59:47.371Z”)})

WriteResult({ “nMatched” : 1, “nUpserted” : 0, “nModified” : 1 })

MongoDB Enterprise mflix-shard-0:PRIMARY> db.test.find()
{ “_id” : ObjectId(“5c2cb2042cdf0e0cdca72a07”), “a” : 1, “b” : 1 }
{ “_id” : ObjectId(“5c2cb2092cdf0e0cdca72a08”), “a” : 2, “b” : 3 }
{ “_id” : ObjectId(“5c2cb20b2cdf0e0cdca72a09”), “a” : 2, “b” : 15 }
{ “_id” : ObjectId(“5c2cb20f2cdf0e0cdca72a0a”), “a” : 2, “b” : 15 }
{ “_id” : ObjectId(“5c447282b5c23724aa3b30ec”), “date” : ISODate(“2999-01-18T06:59:47.371Z”) }
`

Hi Kanika,

Thank you for checking. Issue seems to be on Robo 3T as I was trying on it.

Regards,
Vishwanath