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

Recent/Favorite Filter Queries - String Pattern Issue

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: CRUD
    • None
    • Environment:
      MongoDB Compass Version 1.35.0
    • Not Needed

      Problem Statement/Rationale

      I created a filter for one of my tables to check where a field contains a certain value. When I run it initially, the filter works. When I load it from the recent/favorites, it will work as is. BUT if I change part of the filter, the string pattern check stops working correctly, and I have to reset it how I originally wrote the filter (which is different than how it saved). 

      Please be sure to attach relevant logs with any sensitive data redacted.

      Steps to Reproduce

      0. You will need some data with fields creationDate and fileName

      1. Create a filter like: 

      {creationDate: \{$gt: ISODate('2023-03-18T00:00:00.000Z')},fileName: /SomeText/}

      2. Reload the filter from Recents or Favorite. You will now see the filter shows as: 

      {creationDate: \{$gt: ISODate('2023-03-17T00:00:00.000Z')},fileName: {pattern: 'SomeText',options: ''}}

      3. This new filter format will work if you run it as is. However, if you change the date from 3-17 to 3-18 and try to fun the filter, it will not show any results matching your string text. 

      4. Change your filter (with the new date of 3-18) to fileName: /SomeText/ instead of fileName: {pattern: 'SomeText',options: ''}

      5. Run this filter, and you will see that /SomeText/ works where fileName: {pattern: 'SomeText',options: ''} had returned no results.

      Expected Results

      Expected results of this filter: Return data elements with a date reater than 3-18 with fileName containing SomeText

      Recommendation: Either save the filter as it is written with slashes (/SomeText/) or ensure the filter format with pattern and options will return results as expected. 

      Actual Results

      No results returned when I change the date to 3-18, but the data is there - I have to change the filter pattern/options back to slash format to get the results.

      Additional Notes

      If there is another option to filter by date=today, that would help as well, so that I do not have to change the date every day to check for results. 

      Attached documentation with screenshots of issue.

            Assignee:
            Unassigned Unassigned
            Reporter:
            cr851h@att.com CHELSEA RICKEL
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: