Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ilike operator and default operator for mongo filters #22

Closed
michael-dean-haynie opened this issue Jun 23, 2022 · 1 comment
Closed

Comments

@michael-dean-haynie
Copy link
Collaborator

❗These are breaking changes and should probably be coordinated with the frontend team.

1. Update ilike to $like
The MongoDB-Style filtering logic supports a custom operator we've been calling ilike. We want to change this to $like to be more consistent with the other mongo operators (which all start with "$").

Example:

  • Previous Format: filter[name][ilike]=brad --> { LIKE: [ '#name', '%brad%' ] }
  • New Format: filter[name][$like]=brad --> { LIKE: [ '#name', '%brad%' ] }

2. Update default operator behavior for strings
Currently, if the filter parameter in the querystring omits the operator part for a string value, it will default to ilike.
We want to change this to strict equality ($eq)

Example:

  • Previous Functionality: filter[name]=brad --> { LIKE: [ '#name', '%brad%' ] }
  • New Functionality: filter[name]=brad --> { '=': [ '#name', 'brad' ] }

Also In-scope

  • Updating unit tests and descriptions
  • updating readme descriptions and examples
@roy-coder
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants