[JAVA-1768] JsonReader doesn't parse ISODate strings in $date fields Created: 17/Apr/15 Updated: 05/May/15 Resolved: 19/Apr/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | JSON |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | 3.0.1, 3.1.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Florian Bücklers | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
all |
||
| Description |
|
The JsonReader doesn't parse ISODateStrings in extended JSON format. { "$date" : "2015-04-16T14:55:57.626Z" } { "$date" : "2015-04-16T16:55:57.626+02:00" }The older JSONCallback based parser account this case. |
| Comments |
| Comment by Jeffrey Yemin [ 05/May/15 ] |
|
Closed for 3.0.1 release. |
| Comment by Githook User [ 19/Apr/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: In JsonReader, replaced SimpleDateFormat with DatatypeConverter.parseDateTime, as Java 6 does not support the 'X' pattern character. |
| Comment by Githook User [ 19/Apr/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: In JsonReader, replaced SimpleDateFormat with DatatypeConverter.parseDateTime, as Java 6 does not support the 'X' pattern character. |
| Comment by Jeffrey Yemin [ 19/Apr/15 ] |
|
Re-opening because SimpleDateFormat doesn't support the 'X' pattern character until Java 7, but the driver must run on Java 6. |
| Comment by Jeffrey Yemin [ 17/Apr/15 ] |
|
Still internally discussing the right behavior of JsonWriter, so to move this forward I'll open that as a separate ticket. |
| Comment by Florian Bücklers [ 17/Apr/15 ] |
|
I can also add the JsonWriter logic as well, if it helps to solve the ticket. Do wan't to write all $date values as strings by default now? |
| Comment by Florian Bücklers [ 17/Apr/15 ] |
|
I have created a pull request: https://github.com/mongodb/mongo-java-driver/pull/307 |