From d2abd4b05b0e4cf9e3552b64246c876a25b0bed3 Mon Sep 17 00:00:00 2001 From: Akalanka Perera Date: Thu, 11 Jul 2024 23:36:54 +0530 Subject: [PATCH] Fix(filter-query): bug in not equals boolean parsing --- packages/mongoose-filter-query/src/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/mongoose-filter-query/src/utils.js b/packages/mongoose-filter-query/src/utils.js index 1334850..3e71a34 100644 --- a/packages/mongoose-filter-query/src/utils.js +++ b/packages/mongoose-filter-query/src/utils.js @@ -25,7 +25,11 @@ export const mapValue = (value) => { } return { $eq: value }; } else if (value.startsWith("ne(")) { - return { $ne: parseOperatorValue(value, "ne") }; + value = parseOperatorValue(value, "ne"); + if (value === "true" || value === "false") { + return { $eq: value === "true" }; + } + return { $ne: value }; } else if (value.startsWith("gt(")) { return { $gt: parseOperatorValue(value, "gt") }; } else if (value.startsWith("gte(")) {