From 2e87dbeaf95d0efaea3f1f0d59471917cf79f4f2 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 1 Feb 2023 19:31:54 +0800 Subject: [PATCH] fix(nocodb): condition notempty logic --- .../nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts index 9281e4ceb1..dca95c9a0e 100644 --- a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts @@ -396,7 +396,9 @@ const parseConditionV2 = async ( else if (filter.value === 'empty') qb = qb.where(customWhereClause || field, ''); else if (filter.value === 'notempty') - qb = qb.whereNot(customWhereClause || field, ''); + qb = qb + .whereNot(customWhereClause || field, '') + .orWhereNull(field); else if (filter.value === 'true') qb = qb.where(customWhereClause || field, true); else if (filter.value === 'false')