Steps to reproduce
- Use the
@feathersjs/mongodb adapter as a datasesource adapter for your project
- Add the operator to the queryable fields in the TypeBox querySchema as follows
export const tagQuerySchema = Type.Intersect(
[
querySyntax(tagQueryProperties, {
title: {
$regex: Type.Any()
}
}),
// Add additional query properties here
Type.Object({}, { additionalProperties: false })
],
{ additionalProperties: false }
)
- Query the collection with the following query
app.service('tags').find({
query: {
title: {
$regex: /(?:)/i
}
}
})
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):
- Feathersjs ^5.0.11
- Mongodb ^6.1.0
NodeJS version:
Operating System:
Steps to reproduce
@feathersjs/mongodbadapter as a datasesource adapter for your projectExpected 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
operatorsoption (which is marked as deprecated) it works fine.System configuration
Module versions (especially the part that's not working):
NodeJS version:
Operating System: