Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-7979

$regex queries are incorrectly saved in query history

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

      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 Unassigned
            Reporter:
            elizabeth.button@mongodb.com Betsy Button
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: