[SERVER-3680] Creating dates with date strings in mongo shell no longer works Created: 23/Aug/11  Updated: 14/May/14  Resolved: 24/Aug/11

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.0.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change
Operating System: ALL
Participants:

 Description   

In 2.0:
> new Date("2011-08-23")
ISODate("0NaN-NaN-NaNTNaN:NaN:NaNZ")

In 1.8.2:
> new Date("2011-08-23")
ISODate("2011-08-23T00:00:00Z")



 Comments   
Comment by Eliot Horowitz (Inactive) [ 24/Aug/11 ]

Yeah - all 1.7 which is all we officially support work this way.
xulrunner is different.

Comment by Spencer Brody (Inactive) [ 24/Aug/11 ]

Reproduced the problem on my mac, but it fails for every mongo version I try to compile. I have spidermonkey 1.7.0 on my mac.
Looks like its a bug in spidermonkey that's been fixed in newer versions.

Comment by Spencer Brody (Inactive) [ 24/Aug/11 ]

Using Ubuntu 11.4 64 bit. It worked on the official build for 1.8.2 as well as 1.8.2, 1.8.3, and 1.9.2 built on my local.

I isolated the source of the breakage to https://github.com/mongodb/mongo/commit/d40cad9feb14c0a2be44ddbe693a178181c4dbb1, the commit that put spidermonkey into the source.

I get spidermonkey from xulrunner version 1.9.2 on my linux box.

Comment by Eliot Horowitz (Inactive) [ 24/Aug/11 ]

Always give os/version/etc...
Were these official builds?

Comment by Spencer Brody (Inactive) [ 24/Aug/11 ]

Worked for me in 1.8.2, 1.8.3 and 1.9.2. The only version it fails for me on is from master.

Comment by Spencer Brody (Inactive) [ 24/Aug/11 ]

Worked for me using 1.8.2 from the official package. When I get into the office ill try building 1.8.2 and see if I can get it to work.

Comment by Eliot Horowitz (Inactive) [ 24/Aug/11 ]

Which version is it working for you in?
Its failing for me in all versions

Generated at Thu Feb 08 03:03:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.