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

Setting DBEncoder for $cmd collection has no effect

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.0.0
    • Affects Version/s: 2.7.2
    • Component/s: Codecs
    • Labels:
      None
    • Environment:
      Fedora Linux 16 64bit, Mongodb 2.0.3

      When running the attached TestCase, I'll not see any outputs due to the fact that findAndModify Operations are run from the $cmd Collection. The corresponding DBApiLayer.MyCollection.__find(DBObject, DBObject, int, int, int, int, ReadPreference, DBDecoder) call is accessing OutMessage.query without handling a DBEncoder, so the driver falls back to the defaultEncoder ignoring custom set Encoders through db.getCollection("$cmd").setDBEncoderFactory(). From my point of view the driver should be set per Default to a given Encoder/Decoder(-Factory), which then can be overriden with a custom Encoder/Decoder(-Factory).

      Attached is as well a patch fixing this specific mentioned problem, but other locations referencing DB(En|De)coder.FACTORY should be considered for changes as well.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            pheinze Philipp Heinze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: