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

Incorrectly resolved boolean expressions in linq projections

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      Client is built from git commit 3a68dc116f5e320709c8.
      Data object:

      class Foo
      {
      [MongoAlias("bar")]
      public int Bar

      { get; set; }
      [MongoAlias("ispublic")]
      public bool Public { get; set; }

      }

      The following query fails to produce results:

      var coll = db.GetCollection<Foo>("foo");
      coll.Linq().Count(f => f.Public && f.Bar > 50);

      After db.setProfilingLevel(2):

      > db.system.profile.find()
      { "ts" : "Sun Jun 27 2010 23:16:07 GMT+0200 (CEST)", "info" : "query tempdb.$cmd ntoreturn:1 command: { count: \"foo\", query: { ispublic: { Bar:

      { $gt: 50 }

      } } } reslen:57 bytes:41", "millis" : 0 }

      If i rewrite the query, it works properly:

      coll.Linq().Count(f => f.Public == true && f.Bar > 50);

      > db.system.profile.find()
      { "ts" : "Sun Jun 27 2010 23:26:47 GMT+0200 (CEST)", "info" : "query tempdb.$cmd ntoreturn:1 command: { count: \"foo\", query: { ispublic: true, bar:

      { $gt: 50 }

      } } reslen:57 bytes:41", "millis" : 0 }

      Attachments

        Activity

          People

            craig.wilson@mongodb.com Craig Wilson
            enyim Attila Kisko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: