I am new to MongoDB. I have designed a app with a follower/following like Twitter style
My schema is as follows
UserSchema :
username:'Alex',
pass:'salted',
likes:'200'
FollowSchema
uid : {
type: Schema.ObjectId,
ref: 'User'
},
fid : {
type: Schema.ObjectId,
ref: 'User'
}
First of all, is this a scalable design ?
If so, I would like to get all the users except logged in user and find if each user is following the logged in user or not.
I am thinking of Aggregation or mapreduce but not sure how to approach.Any help is appreciated.
Thx