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

java.lang.Character could be encoded as a BSON string

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.8.0
    • Affects Version/s: 2.7
    • Component/s: API
    • Labels:

      Putting a Character into a BSONObject will result in "json can't serialize type : class java.lang.Character".

      The easy workaround is to use a String instead of Character.
      However, the BSON encoder could be doing this lossless conversion automatically, and encode a Java character as a BSON one-character string. This would be in line with how both arrays and lists are accepted for BSON arrays.
      Of course, decoding this data would return a String.

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            thiloplanz Thilo Planz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: