If I have a string property, SomeString, that is missing from some documents in a collection, querying on this property is really hard. It's complicated that the querying in the traditional filter/$match semantics doesn't match the semantics of a $expr or $project expression.
This will match on documents missing the SomeString field.
.Select(c => new { IsNull = c.SomeString!= null })
{ "$project" : { "IsNull" : { "$ne" : ["$SomeString", null] }, "_id" : 0 } }
However, this will exclude documents missing that field:
{ "$match" : { "SomeString" : { "$ne" : null } } }
.Where(c => c.SomeString!= null)
This is super frustrating and is not obviously expression in vanilla C#/.Net. The assumption in the .Net/C# querying code is that the field exists since we're querying on a static type (as opposed to, say, an ExpandoObject).
(Moved this issue over from bitbucket)