strongloop / loopback-filters

implements LoopBack-style filtering.
http://loopback.io
Other
55 stars 22 forks source link

`Regexp` and `ilike` filter operators #13

Open BackupBroom opened 7 years ago

BackupBroom commented 7 years ago

Bug or feature request

Description of feature (or steps to reproduce if bug)

Loopback currently supports regexp and ilike operators for where filters, but I don't see support for that in this repo. Are there plans to add these two filter operators to this repository?

Thanks.

Expected result

const filterNodes = require('loopback-filters');
const data = [ { name: 'asd' }, { name: 'fAgh' }, {name: 'qwe'}, { name: 'jkAl' }];

filterNodes(data, { where: { name: { regexp: '/\w*[aA]\w*/i' } } }) // asd, fAgh, jkAl
filterNodes(data, { where: { name: { ilike: '%a%' } } }) // same
bajtos commented 6 years ago

AFAICT, regexp has been already added by https://github.com/strongloop/loopback-filters/pull/20. We don't have bandwidth to add support for ilike ourselves, but are happy to help you if you decide to contribute this feature yourself.

bajtos commented 6 years ago

Cross-posting my https://github.com/strongloop/loopback-filters/issues/10#issuecomment-351646274:

Ideally, loopback-datasource-juggler's memory connector would be using loopback-filters under the hood and there was only a single place where to add support for new filtering features. Unfortunately we haven't had bandwidth to do that change, and as a result loopback-filters is always behind loopback capabilities. Any volunteers to contribute this change?

bajtos commented 6 years ago

I created a new issue in juggler to keep track of the work of using loopback-filters under the hood: https://github.com/strongloop/loopback-datasource-juggler/issues/1529

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.