How to model a system of friends with Mongodb?

Asked

Viewed 192 times

1

I’m creating a small social network and I need to create the friendships part.

I have two ideas:

  1. A Collection Friendships containing the fields sender, destnatary and answer and make a populate with Mongoosis.
  2. Place a Friend object inside the user document containing that user’s friends and make one populate with Mongoosis.

Which of these is a better performance? Or is there another more effective way?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.