Skip to content

Commit

Permalink
Fix(filter-query): bug in not equals boolean parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 authored Jul 11, 2024
1 parent e742a28 commit d2abd4b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/mongoose-filter-query/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(")) {
Expand Down

0 comments on commit d2abd4b

Please sign in to comment.