UUID endianness used by the Java Driver is not the same with the one used by MongoShell

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.11.3
    • Component/s: BSON, Codecs
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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).

            Assignee:
            Unassigned
            Reporter:
            Emil Goicovici
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: