-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Codecs, Command Operations
-
None
-
Java Drivers
-
Not Needed
-
JAVA-5304 highlights that when using a Polymorphic MongoCollection type Operations use the instance class to look up the codec from the repository rather than using the MongoCollection document class.
For example:
MongoCollection<Pet> collection.insertOne(myDog);
In this case the Operations helper will lookup myDog.class from the codec registry rather than using the MongoCollection document class (Pet.class). This can lead to loss of discriminator information with bson-kotlinx.