Skip to content

Commit

Permalink
fix: issue to wrong option in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jun 29, 2023
1 parent bb90ba2 commit 49ebb7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

*
* Issue related to wrong regex option in MongoDB

## [1.31.1] - 2023-05-31

Expand Down
4 changes: 2 additions & 2 deletions src/appier/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@ def _find_s(cls, kwargs):
# exact match of the value (required type conversion)
if default_t in legacy.STRINGS: find_v = {
"$regex" : right + re.escape(find_s) + left,
"$options": "-i" if find_i else ""
"$options": "i" if find_i else ""
}
else: find_v = default_t(find_s)
except Exception:
Expand Down Expand Up @@ -2000,7 +2000,7 @@ def _find_d(cls, kwargs):
# the value is used directly, then merges this find value into the
# current set of filters for the provided (keyword) arguments
find_v = {operator : value} if operator else value
if insensitive: find_v["$options"] = "-i"
if insensitive: find_v["$options"] = "i"
cls.filter_merge(name, find_v, kwargs, operator = find_o)

@classmethod
Expand Down

0 comments on commit 49ebb7a

Please sign in to comment.