[COMPASS-6626] Recent/Favorite Filter Queries - String Pattern Issue Created: 20/Mar/23  Updated: 21/Mar/23  Resolved: 21/Mar/23

Status: Closed
Project: Compass
Component/s: CRUD
Affects Version/s: None
Fix Version/s: No version

Type: Bug Priority: Minor - P4
Reporter: CHELSEA RICKEL Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB Compass Version 1.35.0


Attachments: Microsoft Word MongoDB Compass Saved Filter Issue.docx    
Issue Links:
Duplicate
duplicates COMPASS-6470 Recent and favourited queries are not... Closed
Documentation Changes: Not Needed

 Description   

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.



 Comments   
Comment by CHELSEA RICKEL [ 21/Mar/23 ]

Okay, thank you for the update! 

Comment by Sergey Petushkov [ 21/Mar/23 ]

Thanks for reporting the issue, we are already tracking this in COMPASS-6470

Generated at Wed Feb 07 22:43:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.