You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got this scenario where I have a select field containing a bunch of site names with site ids as values.
I would like to be able to filter my query so that I can get the objects where the value of this field is either null OR one of the values is a specific ID that I pass to the filter.
I believe it would be something like this, in this example I'm getting the ProductSimple objects if the ProductSites select field contains 1,2 or 4 as values.
This will return results where productSites contains a value of 12, 21, 201 etc.
As a sidenote/question:
I don't think this way of checking for null works either, but I am not sure how to do it.. if anyone knows I'd gladly take your input!
The text was updated successfully, but these errors were encountered:
This seems to work for checking null and a LIKE for the ID.. which does still give false positives but it's the best option it seems until such time that IN is a valid operator.
Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.
Improvement description
I've got this scenario where I have a select field containing a bunch of site names with site ids as values.
I would like to be able to filter my query so that I can get the objects where the value of this field is either null OR one of the values is a specific ID that I pass to the filter.
I believe it would be something like this, in this example I'm getting the ProductSimple objects if the ProductSites select field contains 1,2 or 4 as values.
getProductSimpleListing(filter: "{ \"$or\": [{\"ProductSites\": \"null\"}, {\"ProductSites\": {\"$in\": [\"1,2,4\"]}}], }") {
However
$in
is not a supported operator so this simply gives me an Internal server error.At least that is what I think is happening..
Because this is the old docs:
https://pimcore.com/docs/pimcore/6.9/Development_Documentation/Web_Services/Query_Filters.html
And in the new docs, I've not been able to find a similar reference.
I know that I can use
$like
BUT that gives false positives.\"$or\": [{\"ProductSites\": \"null\"}, {\"ProductSites\": {\"$like\": \"%1%\"}}]
This will return results where productSites contains a value of 12, 21, 201 etc.
As a sidenote/question:
I don't think this way of checking for null works either, but I am not sure how to do it.. if anyone knows I'd gladly take your input!
The text was updated successfully, but these errors were encountered: