mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 13:15:58 +08:00
feat: regex operator is added in the string type for all data source (#3362)
This commit is contained in:
parent
c8bad4fc79
commit
458cff32fd
@ -260,6 +260,8 @@ export const OPERATORS = {
|
||||
NIN: 'NOT_IN',
|
||||
LIKE: 'LIKE',
|
||||
NLIKE: 'NOT_LIKE',
|
||||
REGEX: 'REGEX',
|
||||
NREGEX: 'NOT_REGEX',
|
||||
'=': '=',
|
||||
'!=': '!=',
|
||||
EXISTS: 'EXISTS',
|
||||
@ -284,6 +286,8 @@ export const QUERY_BUILDER_OPERATORS_BY_TYPES = {
|
||||
OPERATORS.NOT_CONTAINS,
|
||||
OPERATORS.EXISTS,
|
||||
OPERATORS.NOT_EXISTS,
|
||||
OPERATORS.REGEX,
|
||||
OPERATORS.NREGEX,
|
||||
],
|
||||
int64: [
|
||||
OPERATORS['='],
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { OPERATORS } from 'constants/queryBuilder';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import * as Papa from 'papaparse';
|
||||
|
||||
import { orderByValueDelimiter } from '../OrderByFilter/utils';
|
||||
|
||||
export const tagRegexp = /([a-zA-Z0-9_.:@$()\-/\\]+)\s*(!=|=|<=|<|>=|>|IN|NOT_IN|LIKE|NOT_LIKE|EXISTS|NOT_EXISTS|CONTAINS|NOT_CONTAINS)\s*([\s\S]*)/g;
|
||||
export const tagRegexp = /([a-zA-Z0-9_.:@$()\-/\\]+)\s*(!=|=|<=|<|>=|>|IN|NOT_IN|LIKE|NOT_LIKE|REGEX|NOT_REGEX|EXISTS|NOT_EXISTS|CONTAINS|NOT_CONTAINS)\s*([\s\S]*)/g;
|
||||
|
||||
export function isInNInOperator(value: string): boolean {
|
||||
return value === OPERATORS.IN || value === OPERATORS.NIN;
|
||||
@ -56,6 +55,10 @@ export function getOperatorValue(op: string): string {
|
||||
return 'in';
|
||||
case 'NOT_IN':
|
||||
return 'nin';
|
||||
case OPERATORS.REGEX:
|
||||
return 'regex';
|
||||
case OPERATORS.NREGEX:
|
||||
return 'nregex';
|
||||
case 'LIKE':
|
||||
return 'like';
|
||||
case 'NOT_LIKE':
|
||||
@ -81,6 +84,10 @@ export function getOperatorFromValue(op: string): string {
|
||||
return 'NOT_IN';
|
||||
case 'like':
|
||||
return 'LIKE';
|
||||
case 'regex':
|
||||
return OPERATORS.REGEX;
|
||||
case 'nregex':
|
||||
return OPERATORS.NREGEX;
|
||||
case 'nlike':
|
||||
return 'NOT_LIKE';
|
||||
case 'exists':
|
||||
|
@ -17,6 +17,8 @@ const operatorTypeMapper: Record<string, OperatorType> = {
|
||||
[OPERATORS['>']]: 'SINGLE_VALUE',
|
||||
[OPERATORS.LIKE]: 'SINGLE_VALUE',
|
||||
[OPERATORS.NLIKE]: 'SINGLE_VALUE',
|
||||
[OPERATORS.REGEX]: 'SINGLE_VALUE',
|
||||
[OPERATORS.NREGEX]: 'SINGLE_VALUE',
|
||||
[OPERATORS.CONTAINS]: 'SINGLE_VALUE',
|
||||
[OPERATORS.NOT_CONTAINS]: 'SINGLE_VALUE',
|
||||
[OPERATORS['=']]: 'SINGLE_VALUE',
|
||||
|
Loading…
x
Reference in New Issue
Block a user