I have a users index which has fields like id, email, password, etc. A user can see all other users except the ones who had blocked him. I want to design a database schema for this problem.
So I'm using MongoDB and I have these two tables.
id email password 01 email@example.com 123 02 firstname.lastname@example.org XYZ
now, I need a way to store the block relations information. If x has blocked y then y can't see x on the user's list.
If I add an array in user y which contains all user id who has blocked them so would it be a good solution? or is there any other alternative?
id email password blockedBy 01 email@example.com 123  02 firstname.lastname@example.org XYZ [01, 07]
now, I'll show all the users to user 02 except 01 and 07.