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

Version 2.19 breaks ToUpper comparison

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 2.19.0
    • Component/s: LINQ3
    • None
    • None
    • 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

      With the latest version of the mongo db c# driver and linq3, the expression comparison of a string value with the call of a ToUpper is broken.

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

      How to Reproduce

      I want create a dynamic query and create a query expression like this

      item => ((item.StringValue != null) AndAlso item.StringValue.ToUpper().Contains("foo"))

      which then translate into this

      database.collection.Aggregate([{ "$match" : { "$and" : [{ "stringValue" :

      { "$ne" : null }

      }, { "_id" :

      { "$type" : -1 }

      }] } }])

      Additional Background

      -

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            mo1987@gmx.net Martin Oehlert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: