All the schemas are separate collection, you can name it follow or what the fuck if you like it that way. Absence of end field indicate user is still following and vice versa. Keeping it this way helps you track the history without much complications.
If your followers and followee are only one data node e.g. users, this schema will work for you.
{
follower : ‘id’,
followee : ‘id’,
start : ‘data’,
end : ‘date’
}
If your followers are only users but your followees can be multiple data nodes e.g. page, user etc, this schema will work for you.
{
follower : ‘id’,
followee : ‘id’,
followee_collection : ‘collection name’,
start : ‘data’,
end : ‘date’
}
If your followers and followees can be multiple data nodes e.g. page, user etc, this schema will work for you.
{
follower : ‘id’,
follower_collection : ‘collection name’,
followee : ‘id’,
followee_collection : ‘collection name’,
start : ‘data’,
end : ‘date’
}
Email me when Ravi Suhag publishes or recommends stories