Typebox QuerySchema - Querying array mongoDB #3059
Replies: 3 comments 1 reply
-
I think the best way to address this would be to customise the query properties. So instead of export const contactsQueryProperties = Type.Pick(contactsSchema, ['contactTags', 'deletable']) Use export const contactsQueryProperties = Type.Object({
contactTags: Type.Number(),
deletable: Type.Boolean()
}) This should create the query syntax you are looking for. |
Beta Was this translation helpful? Give feedback.
-
I can confirm that this makes EDIT: Perhaps there's a chance the changes to |
Beta Was this translation helpful? Give feedback.
-
Querying with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My feathers version is 5.0.0-pre.37
My service schema is:
The query I want to perform is:
http://localhost:3032/contacts?$or[1][contactTags]=1&$or[0][deletable]=true
What works is
http://localhost:3032/contacts?contactTags=1
But when using the query with $or, the contactTags: Type.Number() (which is necessary to have the query working without $or) seems not to be passed to the query validator.
The error is:
Perhaps I need to adjust the querySyntax with expanding $or? But how?
Beta Was this translation helpful? Give feedback.
All reactions