System Information
- Strapi Version: 3.6.8
- Operating System: MacOS
- Database: MariaDB 10.5.11
- Node Version: 14.15.5
- NPM Version: 6.14.11
- Yarn Version: none
I have a collection type (called Business Types) that the result is like this:
[
{
"id": 3,
"name": "Rent",
"notAvailableOnPropertyTypes": [
{
"id": 5,
"name": "House",
},
{
"id": 6,
"name": "Apartment",
},
]
}
]
The notAvailableOnPropertyTypes is a relation of type “Business Type has many Property Types”.
I’m trying to find all the records that doesn’t have House (id = 5) in the array.
I have tried:
- business-types?_where[notAvailableOnPropertyTypes_nin]=5
- business-types?_where[notAvailableOnPropertyTypes.id_nin]=5
- business-types?notAvailableOnPropertyTypes_nin=5
- business-types?notAvailableOnPropertyTypes.id_nin=5
The expected result should be:
[
{
"id": 2,
"name": "Sell", // <= is a different record =)
"notAvailableOnPropertyTypes": [] // <- Note that this is empty =)
}
]
Property Types:
- House
- Apartment
Business Types:
- Rent
- Sell
How can i say: Give me all the business types that a House can have?
I have created the notAvailableOnPropertyTypes to help me with this, but I cannot figure out the correct filter using the API.