Skip to content
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

Filter that only matches on exact value #17

Open
smucode opened this issue Apr 28, 2023 · 2 comments
Open

Filter that only matches on exact value #17

smucode opened this issue Apr 28, 2023 · 2 comments

Comments

@smucode
Copy link

smucode commented Apr 28, 2023

Users can both type a value to filter for themselves, or they can click on a property somewhere in the UI. In the latter case, I'd like to treat the search as an exact match. Eg in the following example the filter group:"Group 1" is treated as a wildcard search. But i'd like it to match only users in Group 1:

const EasyFilter = require('@noriller/easy-filter')

const array = [
	{ _id: 1, name: "John", age: 42, group: "Group 1" },
	{ _id: 2, name: "Jane", age: 69, group: "Group 11" }
]

const filter = EasyFilter.default(array)
const result = filter.search('group: "Group 1"')
@Noriller
Copy link
Owner

Right now, I don't think it's possible.
Quotes are more like "match every word inside" rather than "exactly this".

For something like that it would need a new operator, probably just for tag like the range ones, maybe tag:exactly(value), to be checked if its exactly the value or not and I can see it as a useful use case.

@smucode
Copy link
Author

smucode commented Apr 29, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants