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

BsonBinary subtype v4 (UUID Standard) gets converted back to Binary and not UUID

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.12.5
    • Component/s: BSON
    • Labels:
      None

      On reading UUID subtype V4 from MongoDB using mongo-java-driver 3.12.5, BsonBinary subtype v4 (STANDARD Uuid) gets converted back to Binary and not UUID.

      Line of code where this bug occurs:
      https://github.com/mongodb/mongo-java-driver/blob/master/bson/src/main/org/bson/BSONCallbackAdapter.java#L86

      Which throws mapping exception only in case of UUID v4 (and not in V3) : Causing: dev.morphia.mapping.MappingException: Could not map Entity with ID: org.bson.types.Binary@e1123829

      As a result, calling client is forced to add a decoding hook transformer for Binary to UUID

            Assignee:
            Unassigned Unassigned
            Reporter:
            adhunna@expedia.com Arushi Dhunna
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: