feathers icon indicating copy to clipboard operation
feathers copied to clipboard

memory - Allow custom sift options

Open DaddyWarbucks opened this issue 2 years ago • 1 comments

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)

DaddyWarbucks avatar Dec 06 '22 23:12 DaddyWarbucks

Sounds good to me, I'd merge a PR with those changes and according documentation updates.

daffl avatar Dec 08 '22 20:12 daffl