diff --git a/packages/mongoose-filter-query/src/utils.js b/packages/mongoose-filter-query/src/utils.js index ac8750c..6f418ff 100644 --- a/packages/mongoose-filter-query/src/utils.js +++ b/packages/mongoose-filter-query/src/utils.js @@ -43,6 +43,7 @@ export const mapValue = (value) => { } else if (value.startsWith("exists(")) { return { $exists: parseOperatorValue(value, "exists") === "true" }; } + if (value === "true" || value === "false") return value === "true" return value; }; diff --git a/packages/mongoose-filter-query/test/__mocks.js b/packages/mongoose-filter-query/test/__mocks.js index cddf968..2596c57 100644 --- a/packages/mongoose-filter-query/test/__mocks.js +++ b/packages/mongoose-filter-query/test/__mocks.js @@ -29,7 +29,7 @@ export const basicFilterResult = { birthdate: { $lte: new Date("2000-01-01") }, isAlive: { $exists: true }, isVerified: { $eq: true }, - isDeleted: "false" + isDeleted: false }; export const complexFilterReq = {