Many-to-many combinations are easy to use in redbean with simple scripts. But how do you do multiple comparisons between the same object?
Example:
What I want to learn in the structure is very similar to setting the twitter / instagram of "followers" and "followers"
$user = R::dispense('user');
$user2 = R::dispense('user');
$user->sharedUser[] = $user2;
$user2->sharedUser[] = $user1;
Now I want, from the point of view of user1, to list both subscribers and the following users.
However, I cannot list the “subscribers” without asking all the users in the database and looking for user1. Is there a way to have multiple “common” lists in redbean, or is there any good workaround for these specific cases, or is it a way to find the path?