-
Notifications
You must be signed in to change notification settings - Fork 219
feat(sidebar): filter both databases and collections with dot notation #6912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
93ed66a
to
e18c41f
Compare
This is amazing! Thanks @ooorayray !!! |
initialProps: { | ||
connections: mockSidebarConnections, | ||
filter: { | ||
regex: new RegExp('ready_1_1.coll_ready_shared_name', 'i'), // this matches only coll_ready_shared_name collection in ready_1_1 database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this works, the .
has special meaning in the regular expression and I believe it should be escaped here to capture the intent of the change, to mean a literal "." (dot).
regex: new RegExp('ready_1_1.coll_ready_shared_name', 'i'), // this matches only coll_ready_shared_name collection in ready_1_1 database | |
regex: new RegExp('ready_1_1\.coll_ready_shared_name', 'i'), // this matches only coll_ready_shared_name collection in ready_1_1 database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution - it looks good to me 👍 I wonder if it would make sense (in this PR or a follow-up) to do the same for filterDatabases
by passing in the connectionName
too and have that propagate into filterDatabases
as well.
Perhaps this would make more sense in the follow-up. I took a stab at this but it seems more involved: for example, would we allow . as a valid filter? |
Description
Updates the sidebar filter to allow filtering both databases and collections by dot notation: "."
Screen.Recording.2025-05-11.at.3.13.17.AM.mov
Checklist
Motivation and Context
When there are many databases with the same set of collections (think multi-tenancy), filtering by either databases or collections is insufficient. Filtering on both allows one to access a specific database and collection quickly.
Open Questions
Dependents
Types of changes