From 1af833fd43b9783e600fbd875e13b20cbce16733 Mon Sep 17 00:00:00 2001 From: Nastya Date: Wed, 4 Aug 2021 13:14:02 +0300 Subject: [PATCH] [fix] notContains rule did not work because return value of INSTR was expected to be -1 --- README.md | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1cb31bb..67e8d91 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Blocks can be nested like next } ``` -### between / notBeetween +### between / notBetween For those operations, both start and end values can be provided diff --git a/index.js b/index.js index a72c9e7..989c717 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,7 @@ function getSQL(data, config){ case "contains": return { sql:`INSTR(${data.field}, ?) > 0`, values:[filter] }; case "notContains": - return { sql:`INSTR(${data.field}, ?) < 0`, values:[filter] }; + return { sql:`INSTR(${data.field}, ?) = 0`, values:[filter] }; case "lessOrEqual": return { sql:`${data.field} <= ?`, values:[filter] }; case "greaterOrEqual":