feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
14.97k stars 742 forks source link

Service adapter `operators` property marked as deprecated while still needed to use MongoDB specific operators starting with `$` #3431

Open Psycholisk opened 4 months ago

Psycholisk commented 4 months ago

Steps to reproduce

Expected behavior

As per the latest docs, specifying the operator in the querySchema is sufficient to allow custom operators call, without the need to add the option operators: ['$regex'] to the service adapter options.

The query should return the documents that have a title that match this regex expression.

Actual behavior

Instead we get this error error: BadRequest: Invalid query parameter $regex.

Only when I add the operators option (which is marked as deprecated) it works fine.

System configuration

Module versions (especially the part that's not working):

NodeJS version:

Operating System:

seansps commented 3 months ago

I am running into this same issue, is there a workaround?

Edit: I see, I was able to get it to work adding: operators: ['$regex', '$options'],