Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-2727

Like operator does not work in MongoDB translator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.4.1, 8.6
    • 8.4
    • Misc. Connectors
    • None

      The issue is similar to http://stackoverflow.com/questions/5608584/how-to-query-mongodb-with-like-using-the-java-api

      for query like

      select * from city where city like 'ACM%'
      

      Current query expression generated which is correct for javascript environment is

      $match:{ "city" : "/^ACM/"}
      $project:{ "_m0" : "$_id" , "_m1" : "$city" , "_m2" : "$state" , "_m3" : "$pop"}
      

      but when executing from java, java driver wants like

      $match:{ "city" : { "$regex" : "^ACM"}}
      $project:{ "_m0" : "$_id" , "_m1" : "$city" , "_m2" : "$state" , "_m3" : "$pop"}
      

              rhn-engineering-rareddy Ramesh Reddy
              rhn-engineering-rareddy Ramesh Reddy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: