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

Codec Support for any type of Map key

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: POJO
    • Labels:
      None

      Currently, it seems that the default set of Codecs supports just `Map<String, Object>`. This is fine for many use cases, but there is often the use case to use any number of key types.

      Currently, I have a (most likely/ obviously) sub-optimal solution that looks like this: https://stackoverflow.com/questions/67849754/mongodb-mapk-v-codec-maps-must-have-string-keys-fix (not my code)

      This works most of the time, but seems to hate `Map<ObjectId, *>` types.

       

      There should be a standardized codec that can handle any type of map.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            contact@gjstewart.net Greg Stewart
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: