I have a table users with primary index userId. Currently, each user has a field arrayOfRelatedUserIds, so that any one user can have a relationship with several other users. (It’s an array in JSON format). This I know to be not the best solution, and there are better ways of doing this, but I’m just not understanding how. How would I do this without an array? What’s the “legit” method of designing this so that each user be related to several users at once?
I have a table users with primary index userId . Currently, each user has
Share
Create another table
related_userswith 2 columns:userIdrelated_userIdAnd store each relation as a row