Just adding to it before making a github issue per Richards request,
Plain english:
I want all items that dont have a relation with the child item with the name “Sweden”
the entity is specified as
{
"data": [
{
"Name": "Example1",
"restricted_countries": [
{
"Name": "Sweden",
"CountryCode": "SE"
},
{
"Name": "Denmark",
"CountryCode": "DE"
}
]
},
{
"Name": "Example2",
"restricted_countries": [
{
"Name": "Denmark",
"CountryCode": "DE"
}
]
},
{
"Name": "Example3",
"restricted_countries": []
},
{
"Name": "Example4",
"restricted_countries": []
},
{
"Name": "Example5",
"restricted_countries": [
{
"Name": "Denmark",
"CountryCode": "DE"
}
]
}
]
}
Running
filters[restricted_countries][Name][**$eq**]=Sweden
return correct, 1 item, Example1,
If you reverse the logic
filters[restricted_countries][Name][**$ne**]=Sweden
You expect all items but Example1, but you will get the following items:
Example1
Example2
Example5
Adding to this, even writing the query in strapi.entityServcie.findMany() results in the same thing, therefore, is the layman logic at fault?
Thinking if it does some .All(x=>x.Name == ctx.params.filter) logic? as it seems to exclude if the example item ONLY includes Sweden?
Using the above example data, and doing the follow query (now using entity service api)
filters: { restricted_countries:{ Name:{$ne:"Denmark"}}},
You would expect item 3 and 4, but you will get item 1, hence the question if it does all logic instead of any logic?
Just posting here the thoughts and more clear instructions to fault, If you see some obvious fault, else ill provide an example repo with imports to replicate, however I cant provide this untill the project dealine as im already working 80 hour weeks, so then it will be deliverd 14 days from now.
Also, unless im at extreme fault, it dosent seem to matter how low down the query logic chain you go with the query, as im experiencing the same issue at REST as in entityService.
If curiosity gets the better of anyone, Im happy to join in to conversation in open-office-hours to just liveshow.