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

Linq provider needs to support non-constant boolean expressions

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

      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 Unassigned
            Reporter:
            cwaldron Chris Waldron
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: