Linq provider needs to support non-constant boolean expressions

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.8.3
    • Component/s: LINQ
    • None
    • None
    • None
    • None
    • None
    • None

      In the older Samus C# driver supported having non-constant boolean expression in the LINQ query. For example this is a valid expression in the Samus driver...

      //Get the first post having mismatched character count of its body length....
      var post = collection.Linq().First(x => x.CharCount != x.Body.Length);

      However in the official driver this is an invalid expression and throws an ArgumentException...

      //Get the first post having mismatched character count of its body length....
      var post = collection.AsQueryable().First(x => x.CharCount != x.Body.Length);

      In his response, Craig G. Wilson indicates that the Samus driver is transforming the binary expression of a LINQ call into a MapReduce. It would seem that this is what the official driver should do as well. The official driver seems limiting and non-intuitive if it is going to allow LINQ queries. It clearly should support the complete complement of possible binary expressions not just a constant r-expression of a binary expression.

      Here's a link to the question on the mongo-charp forum ...
      https://groups.google.com/forum/#!topic/mongodb-csharp/XAz-TiCctqE

              Assignee:
              Unassigned
              Reporter:
              Chris Waldron
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: