I'm seeing an issue when filtering in the Admin UI where it's not finding a relationship with the "is in" query for certain relationships. It should find it, but it even goes so far as to display it the query is "not in" when clearly it should be there (see picture). This same filtering does work for other relationships, so I'm not sure if this is a Payload issue or an implementation issue on my part, but any insight would be appreciated!
Hi @TheDunco - In your case, in order for the
is in
operator to return your expected result - you would need to input the
entireStripes string value in the value input box.
E.g.
| Stripes | is in | Cust: (Hex/Star, IN/MM) High Leverage, (Hex) Precise Tip Geometry, (Hex) High-Performance Finish...
Does this make sense? Let me know!
That does make sense I suppose, thanks. This makes me think the "is in" operation is more like an "equals" operation, though, which is slightly confusing for polymorphic (many-to-many) relationships. Are there plans to implement more of a "contains" or "includes" query? Because members of my team would like the ability to query relationships in the manner I was initially expecting the "is in" to work.
And/or is there a method for getting this functionality with some fancy logic or something that's currently implemented that I'm not aware of?
Yup! In the dropdown of the filter options, we have a
contains
operation which will do what you were initially expecting to happen
I'm not seeing that option for this many-to-many "Stripes" field.
Ahh - so right now - for
array
fields, you won't have access to the
contains
operation. You would use the
is in
operation.
Filtering on relationships can only be done by ID. If you want to filter on nested fields, you need to use the rest api. So a
containsapproach wouldn't work in the UI
Ah, ok, that makes sense. We can get by filtering by ID. Thanks!