feathers
feathers copied to clipboard
memory - Allow custom sift options
Sift allows a second argument of options which can include custom operators, etc. Similar to other database adapters that accept some database config, I think we should allows this adapter to accept params.matcher. Then Sift configuration can happen on each call.
I am aware that the service options takes a matcher option and I can use a custom Sift here. But that is statically set and cannot change per service call.
This should be as simple as updating https://github.com/feathersjs/feathers/blob/9f712bf5694ceb7b47e3c7ab68a30c8a8cec3faa/packages/memory/src/index.ts#L91 to
const matcher = this.options.matcher(query, params.matcher)
Sounds good to me, I'd merge a PR with those changes and according documentation updates.