Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report for the VS Code MongoDB Playground Date object values #460

Open
dogababacan opened this issue Dec 28, 2022 · 1 comment
Open
Labels
bug Something isn't working

Comments

@dogababacan
Copy link

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"
]
}
]

@alenakhineika
Copy link
Contributor

alenakhineika commented Feb 6, 2023

Hey, thank you for reporting the issue! I have created a VSCODE-363 ticket so you can track the progress.

@alenakhineika alenakhineika added the bug Something isn't working label Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants