[JAVA-2439] MongoCursor returns the date variable as integer value Created: 31/Jan/17 Updated: 27/Oct/23 Resolved: 28/Feb/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Blocker - P1 |
| Reporter: | Vinoth Kumar | Assignee: | Ross Lawley |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
While Querying using MongoCursor the date field returned as integer variable. But when i use dbobject it seems to be return as perfect. When I query using the MongoCursor
When I query using the DBCursor
The method getDB(String) from the type Mongo is deprecated |
| Comments |
| Comment by Ross Lawley [ 28/Feb/17 ] | |
|
We don't have a tentative release date yet, however the next release is scheduled for this quarter. I'm marking this ticket as works as designed only because the current format for the date mirrored the Json emitted by earlier versions of MongoDB tools. As mentioned in a similar ticket ( Its because of this the drivers team has been working on examining and specifying the extended Json format. Please see All the best, Ross | |
| Comment by Vinoth Kumar [ 13/Feb/17 ] | |
|
HI Ross Thanks | |
| Comment by Ross Lawley [ 31/Jan/17 ] | |
|
Hi vinothkumarsubbu, Thanks for the ticket. You are correct that the Document#toJson method defaults to returning dates in the following format:
This supports all dates including pre-epoch dates. In the next release (3.5.0) we are making it easier to customise how bson types are represented in Json - see I hope that clarifies the situation. Ross |