Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1031

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 2.11.3
    • BSON, Codecs
    • None

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            emil.goicovici Emil Goicovici
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: