📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
isContains
Blue Mouse5b092948d90b
diff --git a/backend/apps/cloud/src/analytics/analytics.service.ts b/backend/apps/cloud/src/analytics/analytics.service.tsindex 44a46ad05..1d4c336e4 100644--- a/backend/apps/cloud/src/analytics/analytics.service.ts+++ b/backend/apps/cloud/src/analytics/analytics.service.ts@@ -857,13 +857,14 @@ export class AnalyticsService {return _reduce(parsedFilters,(prev, curr) => {- const { column, filter, isExclusive } = curr+ const { column, filter, isExclusive, isContains = false } = currif (_isArray(filter)) {const filterArray = _map(filter, f => ({column,filter: f,isExclusive,+ isContains,}))return [...prev, ...filterArray]}@@ -1053,8 +1054,6 @@ export class AnalyticsService {isArrayDataset = true}- // TODO: In future I will add contains / not contains filters as well via ILIKE operator-const isNullFilter =filter === null ||(typeof filter === 'string' && filter.toLowerCase() === 'null')diff --git a/backend/apps/cloud/src/analytics/dto/getData.dto.ts b/backend/apps/cloud/src/analytics/dto/getData.dto.tsindex 88e7c3bb3..176fa6e69 100644--- a/backend/apps/cloud/src/analytics/dto/getData.dto.ts+++ b/backend/apps/cloud/src/analytics/dto/getData.dto.ts@@ -45,7 +45,7 @@ export class GetDataDto {@ApiProperty({description:- 'A stringified array of properties to filter [{ column, filter, isExclusive }]',+ 'A stringified array of properties to filter [{ column, filter, isExclusive, isContains }]',required: false,})filters: stringdiff --git a/backend/apps/cloud/src/analytics/dto/getUserFlow.dto.ts b/backend/apps/cloud/src/analytics/dto/getUserFlow.dto.tsindex 566e8d78b..832756966 100644--- a/backend/apps/cloud/src/analytics/dto/getUserFlow.dto.ts+++ b/backend/apps/cloud/src/analytics/dto/getUserFlow.dto.ts@@ -33,7 +33,7 @@ export class GetUserFlowDto {@ApiProperty({description:- 'A stringified array of properties to filter [{ column, filter, isExclusive }]',+ 'A stringified array of properties to filter [{ column, filter, isExclusive, isContains }]',})filters: string}diff --git a/backend/apps/cloud/src/analytics/interfaces/index.ts b/backend/apps/cloud/src/analytics/interfaces/index.tsindex 5feab4fb4..08c9d0609 100644--- a/backend/apps/cloud/src/analytics/interfaces/index.ts+++ b/backend/apps/cloud/src/analytics/interfaces/index.ts@@ -69,7 +69,7 @@ export interface GetFiltersQuery extends Array<string | object | boolean> {0: string// an object that has structure like { cf_pg: '/signup', ev_exclusive: false }1: { [key: string]: string | boolean }- // an array of objects like [{ "column":"pg", "filter":"/signup", "isExclusive":true }]+ // an array of objects like [{ "column":"pg", "filter":"/signup", "isExclusive":true, "isContains":false }]2: Array<{ [key: string]: string }> | []// flag that indicates if there is an 'ev' filter for custom events3: booleandiff --git a/backend/apps/cloud/src/project/dto/create-project-view.dto.ts b/backend/apps/cloud/src/project/dto/create-project-view.dto.tsindex e4e221bd7..8d89ebbbd 100644--- a/backend/apps/cloud/src/project/dto/create-project-view.dto.ts+++ b/backend/apps/cloud/src/project/dto/create-project-view.dto.ts@@ -51,6 +51,7 @@ export interface Filter {column: keyof typeof TRAFFIC_COLUMNSfilter: stringisExclusive: boolean+ isContains?: boolean}export const MAX_METRICS_IN_VIEW = 3@@ -70,7 +71,7 @@ export class CreateProjectViewDto {@ApiProperty({description:- 'An array of properties to filter [{ column, filter, isExclusive }]',+ 'An array of properties to filter [{ column, filter, isExclusive, isContains }]',required: false,isArray: true,})diff --git a/backend/apps/community/src/analytics/analytics.service.ts b/backend/apps/community/src/analytics/analytics.service.tsindex 2d3a55219..1e50cdc6c 100644--- a/backend/apps/community/src/analytics/analytics.service.ts+++ b/backend/apps/community/src/analytics/analytics.service.ts@@ -838,13 +838,14 @@ export class AnalyticsService {return _reduce(parsedFilters,(prev, curr) => {- const { column, filter, isExclusive } = curr+ const { column, filter, isExclusive, isContains = false } = currif (_isArray(filter)) {const filterArray = _map(filter, f => ({column,filter: f,isExclusive,+ isContains,}))return [...prev, ...filterArray]}@@ -1033,8 +1034,6 @@ export class AnalyticsService {isArrayDataset = true}- // TODO: In future I will add contains / not contains filters as well via ILIKE operator-const isNullFilter =filter === null ||(typeof filter === 'string' && filter.toLowerCase() === 'null')diff --git a/backend/apps/community/src/analytics/dto/getData.dto.ts b/backend/apps/community/src/analytics/dto/getData.dto.tsindex 88e7c3bb3..176fa6e69 100644--- a/backend/apps/community/src/analytics/dto/getData.dto.ts+++ b/backend/apps/community/src/analytics/dto/getData.dto.ts@@ -45,7 +45,7 @@ export class GetDataDto {@ApiProperty({description:- 'A stringified array of properties to filter [{ column, filter, isExclusive }]',+ 'A stringified array of properties to filter [{ column, filter, isExclusive, isContains }]',required: false,})filters: stringdiff --git a/backend/apps/community/src/analytics/dto/getUserFlow.dto.ts b/backend/apps/community/src/analytics/dto/getUserFlow.dto.tsindex 566e8d78b..832756966 100644--- a/backend/apps/community/src/analytics/dto/getUserFlow.dto.ts+++ b/backend/apps/community/src/analytics/dto/getUserFlow.dto.ts@@ -33,7 +33,7 @@ export class GetUserFlowDto {@ApiProperty({description:- 'A stringified array of properties to filter [{ column, filter, isExclusive }]',+ 'A stringified array of properties to filter [{ column, filter, isExclusive, isContains }]',})filters: string}diff --git a/backend/apps/community/src/analytics/interfaces/index.ts b/backend/apps/community/src/analytics/interfaces/index.tsindex cfd8052f6..3af6efab0 100644--- a/backend/apps/community/src/analytics/interfaces/index.ts+++ b/backend/apps/community/src/analytics/interfaces/index.ts@@ -63,7 +63,7 @@ export interface GetFiltersQuery extends Array<string | object | boolean> {0: string// an object that has structure like { cf_pg: '/signup', ev_exclusive: false }1: { [key: string]: string | boolean }- // an array of objects like [{ "column":"pg", "filter":"/signup", "isExclusive":true }]+ // an array of objects like [{ "column":"pg", "filter":"/signup", "isExclusive":true, "isContains":false }]2: Array<{ [key: string]: string }> | []// flag that indicates if there is an 'ev' filter for custom events3: booleandiff --git a/backend/apps/community/src/project/dto/create-project-view.dto.ts b/backend/apps/community/src/project/dto/create-project-view.dto.tsindex e4e221bd7..8d89ebbbd 100644--- a/backend/apps/community/src/project/dto/create-project-view.dto.ts+++ b/backend/apps/community/src/project/dto/create-project-view.dto.ts@@ -51,6 +51,7 @@ export interface Filter {column: keyof typeof TRAFFIC_COLUMNSfilter: stringisExclusive: boolean+ isContains?: boolean}export const MAX_METRICS_IN_VIEW = 3@@ -70,7 +71,7 @@ export class CreateProjectViewDto {@ApiProperty({description:- 'An array of properties to filter [{ column, filter, isExclusive }]',+ 'An array of properties to filter [{ column, filter, isExclusive, isContains }]',required: false,isArray: true,})