Skip to content

Commit

Permalink
Merge pull request #180 from sliit-foss/fix/filter-query-default-bool…
Browse files Browse the repository at this point in the history
…ean-parse

Fix(mongoose-filter-query): default boolean parsing
  • Loading branch information
Akalanka47000 authored Apr 20, 2024
2 parents 6c456fa + 2e53191 commit 4371256
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/mongoose-filter-query/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/mongoose-filter-query/test/__mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 4371256

Please sign in to comment.