New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for filtering in saved JSON values (objects & arrays) #14894
Comments
The Related discussion on |
I just just downgraded to Directus 9.14.5, no changes to code or database where made. The query works again, which means this functionality has been removed with |
@madc This is resulting from #14829 where the filter is validated against the following allowable filter operators. directus/packages/shared/src/utils/get-filter-operators-for-type.ts Lines 44 to 45 in bbe7cb9
|
It is also essential for us to have the |
Thanks for pointing this out. After looking at this, there are currently two possible ways of dealing with this while staying on
Both seem not ideal, also given that the default type for a multi-select dropdown is JSON. I think it wouln't hurt anyone and at least help @nazariydj and me out.. |
Contains was never built to work reliably on I don't think officially enabling "contains" for use on JSON fields is the right way to go here @licitdev, as that sets the wrong expectations. The real solution here is to implement the proper JSON search/extraction capabilities as per #7277. Lets leave this issue open as the action item for #7277, as the question comes up often 👍🏻 |
_contains
filter not available for JSON fields anymore
This issue appears to be resolved by #15889 |
Will the mentioned PR enable using |
Linear: ENG-213 |
Describe the Bug
Up until version 9.14, we were able to use the
_contains
filter on a JSON field (multi-select dropdown) containing an array.Since updating to 9.15 the following error is shown,
_contains
is still suggested as possible filter.We use this to fetch news for one or more categories.
To Reproduce
Create a Multi-Select dropdown field and try fetch records filtered by by a certain value:
Errors Shown
"json" field type does not contain the "_contains" filter operator
What version of Directus are you using?
9.15.1
What version of Node.js are you using?
16.16.0
What database are you using?
MySQL
How are you deploying Directus?
via npm
The text was updated successfully, but these errors were encountered: