$regex queries are incorrectly saved in query history

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS: mac
      Additional info: Compass version 1.43.0
    • Not Needed
    • None
    • Developer Tools

      Problem Statement/Rationale

      When queries are run that include $regex, they are incorrectly saved in the query history. 

      For example, I ran the following query: 

      {"email": \{"$regex": "@gmail.com$"}}

      and it was saved as the following, which is incorrect MQL for string pattern matching: 

      { email: \{ pattern: "gmail.com$", options: "" } }

      Steps to Reproduce

      1. Run a query that includes $regex
      2. Click on the query history and observe that an incorrect query was stored

      Expected Results

      I expect the same query to be stored in the history. 

      Actual Results

      I observe incorrect MQL stored in the history. 

      Additional Notes

      This was discovered in https://feedback.mongodb.com/admin/v3/ideas/48508754 

              Assignee:
              Unassigned
              Reporter:
              Betsy Button
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: