Description
Bug Report
So when I was working with the mongoDB playground on VS Code in the example below there was a problem where dates before 1970 (Unix Epoch) shown as $numberlong which is also shown below it is I guess they are stored as negative numbers however I can see the values as normal dates in the mongoDB(the website) itself. I am not sure if this is a bug or not I wanted to share cause I do not have solution for it too see on my playground on VS Code.
Current Behavior
use('NetflixDB');
db.NetflixActors.insertMany([
{
name: 'Elizabeth Debicki',
dateOfBirth: new Date("1990-08-24"),
nationality: 'French'
},
{
name: 'Christopher Nolan',
dateOfBirth: new Date("1970-07-30"),
nationality: 'English',
type: ['Director','Writer']
},
{
name: 'Guy Ritchie',
dateOfBirth: new Date("1968-09-10"),
nationality: 'English',
type: ['Director','Writer']
},
{
name:'Matthew McConaughey',
dateOfBirth: new Date("1969-11-4"),
nationality: 'American',
type: ['Actor']
},
{
name:'Charlie Hunnam',
dateOfBirth: new Date("1980-04-10"),
nationality: 'English',
type: ['Actor']
},
{
name:'Hugh Grant',
dateOfBirth: new Date("1960-09-09"),
nationality: 'English',
type: ['Actor']
}
]);
db.NetflixActors.find({});
--------------------The returning Playground Result is -------------------------------
[
{
"_id": {
"$oid": "63aca9ea248157fa35457fe8"
},
"name": "Elizabeth Debicki",
"dateOfBirth": {
"$date": "1990-08-24T00:00:00Z"
},
"nationality": "French"
},
{
"_id": {
"$oid": "63aca9ea248157fa35457fe9"
},
"name": "Christopher Nolan",
"dateOfBirth": {
"$date": "1970-07-30T00:00:00Z"
},
"nationality": "English",
"type": [
"Director",
"Writer"
]
},
{
"_id": {
"$oid": "63aca9ea248157fa35457fea"
},
"name": "Guy Ritchie",
"dateOfBirth": {
"$date": {
"$numberLong": "-41299200000"
}
},
"nationality": "English",
"type": [
"Director",
"Writer"
]
},
{
"_id": {
"$oid": "63aca9ea248157fa35457feb"
},
"name": "Matthew McConaughey",
"dateOfBirth": {
"$date": {
"$numberLong": "-5018400000"
}
},
"nationality": "American",
"type": [
"Actor"
]
},
{
"_id": {
"$oid": "63aca9ea248157fa35457fec"
},
"name": "Charlie Hunnam",
"dateOfBirth": {
"$date": "1980-04-10T00:00:00Z"
},
"nationality": "English",
"type": [
"Actor"
]
},
{
"_id": {
"$oid": "63aca9ea248157fa35457fed"
},
"name": "Hugh Grant",
"dateOfBirth": {
"$date": {
"$numberLong": "-293846400000"
}
},
"nationality": "English",
"type": [
"Actor"
]
}
]