Add ObjectCodec to default codec registry

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Codecs
    • None
    • None
    • Java Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Java class which has a field of type “Object” (since the field can be of various types), when we try writing to Mongo the customer get an exception “Can't find a codec for class java.lang.Object”.

      To avoid this exception they created a custom Codec for Object (Codec<Object>) and write the encode/decode methods manually (attached).

      The ask is to add it to the default codec registry so they will not have to maintain it.

        1. ObjectCodec.java
          6 kB
          Adir Sharabi

            Assignee:
            Jeffrey Yemin
            Reporter:
            Adir Sharabi
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: