I want to make a chat system with mongodb and nodejs. He has the function of adding friends and grouping friends. I don’t know how to design such mongodb better.
{ _id:, nick:'', account:'', password:'', friends:[ {grounp:' Grouping 1',list:[ User ID1, User ID2]}, {grounp:' Grouping 2',list:[ User ID3, User ID4]} ] }
People clearly asked mongo, but everyone upstairs answered redis. redis is useful for redis. It works well on one-dimensional linear data, but mongo is still needed for data similar to relational data.