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