MongoDB

Can you propose a NoSQL or MongoDB schema that a social media platform may use to perform these functions:

a) Register user details

b) Send/Receive and Accept/Reject friend request from users

c) Create text-only posts and comments on their friend's posts.

Javascript

If you have to create an Insta or FB like content feed for users, then what sort of operations (or APIs) will be needed?

The Insta/FB feed must fulfil below requirements:

a) A user can see only those posts which were created by their friends

b) A user can see posts of people who are not their friends, only if a friend has posted a comment on it