I want to use MongoDB and Node.js in my project. What I need is, modelling the db for friendship relationships(User1 follow User2). Ina relational DB it is easy, but I dont know how to do this with MongoDB. I will also use REST API so I should be able to make relationships via REST api
Edit:
Is it a good way?
following: [[{ type: Schema.Types.ObjectId, ref: 'User' }]]
If I do that, should I save both follower and followed? I am getting too many recursion error.
What all operations you want to do with that?
you may want to check
Twitter-like app using MongoDB