The Queryable translation for Contains converts to a non working regular expression.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • None
    • Affects Version/s: 1.9
    • Component/s: API
    • None
    • Environment:
      windows 2013
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When using this form of c# code (simplified):

      >> var collection = MongoDataConnection.GetCollection<T>(true);
      >> IQueryable<T> qyb = collection.AsQueryable();
      >> var cursor = qyb.Where( e=>e.Name.Contains(astring) ).AsQueryable();

      The resulting mongo command is converted to:

      >> collection.Find(

      {Name:/astring/s}

      )

      which fails with Invalid flags supplied to Regex constructor 's'
      This was also consuming 99% CPU on our servers. This problem has only just materialised.
      When in shell I run :

      >> collection.Find(

      {Name:/astring/s}

      )

      I still get the error - if I convert this to

      >> collection.Find({Name:{$regex:"astring",$options:"s"}})

      it works fine..

      This is a HUGE issue for us.

            Assignee:
            Robert Stam
            Reporter:
            Paul Reed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: