To store the list of following and followers in the database, we will update the user model with two arrays of user references.
mern-social/server/models/user.model.js:
following: [{type: mongoose.Schema.ObjectId, ref: 'User'}],followers: [{type: mongoose.Schema.ObjectId, ref: 'User'}]
These references will point to the users in the collection being followed by or following the given user.