StartsWith, Contains Linq expression bug

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      Windows, VS2010
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When creating a query like so:

      public class MongoContext
      {
      public IQueryable<SomeObject> Objects
      {
      get

      { return collection.Linq(); }

      }
      }

      and calling it with the following:

      var objectsThatStartWithA = mongoContext.Objects.Where(o => o.Name.StartsWith("A"));

      Or:

      var objectsThatStartWithA = mongoContext.Objects.Where(o => o.Name.Contains("A"));

      You get the correct instances from Mongo but all properties are set to null.

      I would guess the best way to implement these would be to use regular expressions although I wasn't able to get these working correctly:

      db.ObjectsDb.Find(

      { Name: /"A"*/ }

      )
      And
      db.ObjectsDb.Find(

      { Name: /*"A"*/ }

      )

            Assignee:
            Craig Wilson
            Reporter:
            nisbus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: