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

Mongo Kotlin driver distinct function does not allow nullable types to be handled 

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.11.2, 5.0.1
    • Affects Version/s: 4.11.0
    • Component/s: Kotlin
    • Labels:
      None
    • Java Drivers
    • Not Needed
    • 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?

      Summary

      Mongo Kotlin driver distinct function for MongoCollection does not allow nullable values to be handled

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      Driver version 4.11.0

       

      How to Reproduce

      i have a simply class that has a nullable field in it and if i run the distinct function from mongoCollection on this field it throws a null pointer acception on the wrapper.hasNext

      i get that a distinct maybe should not return a null value in its list but in my opinion its totally possible for a nullvalue to exist in the database that should behandeld in a way instead of crashing

      Additional Background

      Please provide any additional background information that may be helpful in diagnosing the bug.

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            jamie@teqplay.nl Jamie de Leest
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: