[JAVA-1307] Query operate issue Created: 07/Jul/14 Updated: 07/Jul/14 Resolved: 07/Jul/14 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | 2.12.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Dong [X] | Assignee: | Ross Lawley |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I use Mongodb 2.6.1.
3. use java api function “dbCollection.aggregate(args…)” to query document, the result is
As the result from step 2 and step 3, the field "qty" value is different. |
| Comments |
| Comment by Ross Lawley [ 07/Jul/14 ] |
|
Hi Dong, The Java driver is correct and returning a Double value for qty as that is how it was originally stored. The confusion is caused by how the mongo shell represents numbers. If you specifically need an Integer then in the shell you need to use NumberInt(12). See the shell types documentation for more information. Ross |
| Comment by Dong [X] [ 07/Jul/14 ] |
|
Java driver 2.12.2 also have this issue. |