filter data using value not substring. - #428
chauhanparth210 wants to merge 1 commit into
Conversation
steven-esser
left a comment
There was a problem hiding this comment.
Please sign off your commits using -s on the git CLI
Signed-off-by: chauhanparth210 <00chauhanparth@gmail.com>
| } else { | ||
| query.where.$and[columnName] = { | ||
| $like: `%${columnSearch}%` | ||
| $eq: columnSearch |
There was a problem hiding this comment.
Unfortunately, this will break quite a few filter behaviors. There was a reason why we used a list of values above: Some columns will not filter correctly without a $like.
There was a problem hiding this comment.
If I back with previous code, in that case only three columns are filtered with $eq else filtered the data using $like in that case it uses sub-string rather then using exact value which we provided as a list on the top of column.
But @MaJuRG sir, my doubt is if we already provide a value on the top of column then why we need of ```$like```` query? if it breaks quite filters so will you provide me a test case where it break a filter behavior?
If it breaks the behavior of filter using $eq then the solution of this issue is to update the list of
const exactFilterColumnNames = ['extension', 'programming_language', 'name'];
and append the list to columns and if filter is break on that case then use $like rather then $eq
Thank you @MaJuRG.
There was a problem hiding this comment.
Some columns, like license_key, are lists of values at this time. It turns out that filtering with $eq will not work for lists of values, as it expects to match against the entire list as opposed to a single element.
This is not great from a schema standpoint, I will admit, but at this time this is how things work.
|
@chauhanparth210 Ping. I will close this soon if you have no more updates. |
|
Closing due to stagnation. |
solve : #422
Screenshorts:
filter with File Size:

filter with File Type:

What I do ?
I remove the last case for filter where filter is using substring rather than value.