ADS : 14.0.1
Platform : Ubuntu 12.04 64 bit
MongoDB : 2.4.4 and 2.5.3
When we try to insert date data into a mongo collection via ADS mongoshell using following query:
db.pota.insert({age : 2, manudate : new Date("2013-09-25"), expDate : new Date("2014-09-25")})
The date data is not properly handled and is populated as :
..."manudate" : ISODate("1970-01-01T00:00:00Z"), "expDate" : ISODate("1970-01-01T00:00:00Z")
in the collection. (Pls refer to attached ads_mongoshell.png)
However when we repeat to enter the same data using real mongoshell, it is properly inserted as
..."manudate" : ISODate("2013-09-25T00:00:00Z"), "expDate" : ISODate("2014-09-25T00:00:00Z")
(Pls refer to attached real_mongoshell.png)
Could you please investigate this issue? Thanks
|
|
97 KB
|
|
110 KB
|
|
76 KB
|
|
24 KB
This is a bug in the RhinoEngine component that is used by ADS to process JavaScript in MongoShell and AquaScript. If the date string is specified in the format of "YYYY-MM-DD", it is parsed as an invalid date.
Refer to the attachments that illustrate the problem.
- AquaScript.png - A date string of "YYYY-MM-DD" format can't be parsed by AquaScript.
- MongoShell.png - A date string of "YYYY-MM-DD" format can't be parsed in ADS MongoShell and 2.2 native mongo shell.
Merged the fix from https://bugzilla.mozilla.org/show_bug.cgi?id=586268 to handle ISO8601 date formats.
Merged the fix from https://bugzilla.mozilla.org/show_bug.cgi?id=586268 to handle ISO8601 date formats.
Verified on Mongo 2.6.0 and ADS -Aqua Data Studio 15.0.0-dev-229
Verified on Mongo 2.6.0 and ADS -Aqua Data Studio 15.0.0-dev-229
@rohit: can you verify this against MongoDB 2.6 and earlier version and confirm if this is fixed ?
@rohit: can you verify this against MongoDB 2.6 and earlier version and confirm if this is fixed ?
Aqua Data Studio 15.0.0-dev-263
@Tariq,
db.pota.insert({age : 2, manudate : new Date("2013-09-25"), expDate : new Date("2014-09-25")})
The above statement return same date for both versions (2.4 and 2.6) of Mongo DB in ADS mongoshell and MongoDB mongoshell.
but when i run the below given script the output are different in ADS shell and MongoDB shell.
db.pota.insert({age : 2, manudate : new Date("13-09-25"), expDate : new Date("14-09-25")})
The output returned by ADS Mongoshell is
I have also checked for ADS 14, and it has same behavior as that of current build.
Should we file new issue or reopen this issue ?
Aqua Data Studio 15.0.0-dev-263
@Tariq,
db.pota.insert({age : 2, manudate : new Date("2013-09-25"), expDate : new Date("2014-09-25")})
The above statement return same date for both versions (2.4 and 2.6) of Mongo DB in ADS mongoshell and MongoDB mongoshell.
but when i run the below given script the output are different in ADS shell and MongoDB shell.
db.pota.insert({age : 2, manudate : new Date("13-09-25"), expDate : new Date("14-09-25")})
The output returned by ADS Mongoshell is
I have also checked for ADS 14, and it has same behavior as that of current build.
Should we file new issue or reopen this issue ?
I am marking this issue as fixed. However, the latest test case is actually invalid.
The fix that was merged (https://bugzilla.mozilla.org/show_bug.cgi?id=586268) handles ISO8601 date formats. If you refer to the Mozilla bug report, you'll see that valid ISO8601 date formats are:
YYYY YYYY-MM YYYY-MM-DD
Year is YYYY, not YY.
I am marking this issue as fixed. However, the latest test case is actually invalid.
The fix that was merged (https://bugzilla.mozilla.org/show_bug.cgi?id=586268) handles ISO8601 date formats. If you refer to the Mozilla bug report, you'll see that valid ISO8601 date formats are:
YYYY YYYY-MM YYYY-MM-DD
Year is YYYY, not YY.
Issue #10601 |
| Closed |
| Fixed |
| Resolved |
Completion |
| No due date |
| Fixed Build ADS 15.0.0-dev-38 |
| No time estimate |
1 issue link |
is a duplicate of #10602
Issue #10602Incorrect updation done by $min operator on date data on ADS mongoshell |
This is a bug in the RhinoEngine component that is used by ADS to process JavaScript in MongoShell and AquaScript. If the date string is specified in the format of "YYYY-MM-DD", it is parsed as an invalid date.
Refer to the attachments that illustrate the problem.
- AquaScript.png - A date string of "YYYY-MM-DD" format can't be parsed by AquaScript.
- MongoShell.png - A date string of "YYYY-MM-DD" format can't be parsed in ADS MongoShell and 2.2 native mongo shell.