Filter requires native mysql (%) as wildcard instead of (*) in "like" operation
The loopback mysql connector support % as wildcard but not the asterisk. The data source abstraction should ensure nothing native to the underlying db passes through.
The following works:
{ "where": {"name": { "like": "%Simplicity" } } }
But it would be good to support standard wildcard and do the conversion behind the scenes:
{ "where": {"name": { "like": "*Simplicity" } } }
@simoami Will have a look at that. Need to double check if that may cause any sort of conflicts. Thanks.
* is used for pattern matching on regular expressions.
regexp is different from like operator because regexp match succeeds if the pattern matches anywhere in the value being tested where like match succeeds only if the pattern matches the entire value.
Read more here
TLDR; if you want to use regular expression characteristics, use the regexp operator.
eg. { "where": {"name": { "regexp": "*Simplicity" } } }
Closing this issue as resolved. Feel free to reopen if needed.