System Information
- Strapi Version: 4.25.8
- Operating System: MacOS
- Database: sqlite
- Node Version: 20.10.0
- NPM Version: 10.2.3
- Yarn Version: -
I have the following situation (simplfied for convenience):
There are users and lessons.
User 1 (userId) is attending lesson 1, 2, 3, 4 (lessonId).
User 2 is attending lesson 4, 5, 6.
Being logged is as USER 1, I can show my upcoming lessons with this filtering:
...
sort: ["date:asc"],
filters: {
users_permissions_users: {
$eq: userID, // <-- this line
},
},
fields: ["date", "datename"],
...
Now USER 1 wants to reschedule a lesson to one of the other lessons he is NOT attending. Therefore I want to filter the available lessons like below:
...
sort: ["date:asc"],
filters: {
users_permissions_users: {
$ne: userID, // <-- this line (also tried $notContains, $notIn, $not: {$eq...}, etc.
},
},
fields: ["date", "datename"],
...
The expected result: Only show the lessons I’m not attending (just 2 lessons).
Real result: It shows the 2 lessons I’m not attending (so far so good), but also the lesson i AM attending (lessonId 4) since there is also a different user (userId 2) attending this lesson that not equals ($ne) the current userId (1).
Is there a way to not-show all the lessons when ONE of the attending users_permissions_users equals the current userId?