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).
UUID endianness used by the Java Driver is not the same with the one used by MongoShell
- Assignee:
-
Unassigned
- Reporter:
-
Emil Goicovici
- None
- Votes:
-
0 Vote for this issue - Watchers:
-
2 Start watching this issue
- Created:
- Updated:
- Resolved: