Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4566

Matching on char? throws an ExpressionNotSupportedException

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.19.0
    • Component/s: LINQ3
    • None
    • None
    • Fully Compatible
    • 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?
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Please provide a clear and concise description of the bug.
      Attempting to query on a field of type char? causes the driver to crash.

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

      This is a regression in version 2.19. The same code runs fine without any problem in version 2.18.

      How to Reproduce

      Steps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example.

      using MongoDB.Driver;
      
      MongoClient client = new MongoClient("mongodb://localhost:27017");
      IMongoDatabase db = client.GetDatabase("test");
      IMongoCollection<TestObject> coll = db.GetCollection<TestObject>("foo");
      coll.Find(x => x.Prop == 'a').ToList();
      
      public class TestObject
      {
          public char? Prop { get; set; }
      }
      

      Additional Background

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

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            david.golub@mongodb.com David Golub (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: