[JAVA-1031] UUID endianness used by the Java Driver is not the same with the one used by MongoShell Created: 23/Oct/13 Updated: 23/Oct/13 Resolved: 23/Oct/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | BSON, Codecs |
| Affects Version/s: | 2.11.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Emil Goicovici | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The Java Driver for MongoDB uses little endian integers when decoding an UUID (see the BasicBSONDecoder._binary() method which calls _in.readLong() twice to read two integers using the little endian format). However, MongoShell stores create UUID fields using the big endian format. Therefore, if you create an UUID field using MongoShell and then try to retrieve it using the Java Driver (or vice-versa), the displayed result won't be the expected one (i.e. the value entered at the first step). |
| Comments |
| Comment by Emil Goicovici [ 23/Oct/13 ] |
|
OK, thanks for providing the reference to the initial issue. |
| Comment by Jeffrey Yemin [ 23/Oct/13 ] |
|
Resolving as a duplicate. |
| Comment by Jeffrey Yemin [ 23/Oct/13 ] |
|
This has been reported as |