fix: 🐛 Add support for not equals in MQL expression parsing (#2029)
This commit is contained in:
1 parent
50e4a2adbc
commit
dfd484dbca
1 file changed
+5
@@ -45,6 +45,8 @@ export function generateMQLFilterExpression(filterObj) {
|
||||
return lt(key, value);
|
||||
case 'lte':
|
||||
return lte(key, value);
|
||||
case 'notEquals':
|
||||
return notEquals(key, value);
|
||||
default:
|
||||
return equals(key, value);
|
||||
}
|
||||
@@ -105,6 +107,9 @@ const sanitize = (input) => input?.replace(/(["\\])/g, '\\$1');
|
||||
const equals = (key, value) =>
|
||||
!isEmpty(value) ? `${key} = "${sanitize(value)}"` : null;
|
||||
|
||||
const notEquals = (key, value) =>
|
||||
!isEmpty(value) ? `${key} != "${sanitize(value)}"` : null;
|
||||
|
||||
const contains = (key, value) =>
|
||||
!isEmpty(value) ? `${key} % "${sanitize(value)}"` : null;
|
||||
|
||||
|
||||
Reference in new issue
Block a user