Monday, 1 July 2019

Is there a standard procedure to create a schema for private messages using mongodb and mongoose?

Total novice working on a mock social media site, want to implement a private messaging system.​My current vision for this​CONVERSATION INDEX PAGE---------------User 1- most recent message in conversation-------------------------------------User 2- most recent message in conversation-------------------------------------User 3- most recent message in conversation----------------------Click on one of these and you're taken to the conversation show page. This will be an array of the messages belonging to each conversation​The schemas relating to the conversations are currently something like this in my head:CONVERSATIONconversation{senderID:recipientID:messages: []<----An array of the messages, forgot syntax}messages{userID:username:text:profilePicture:​}------------------------------------​Does this look totally stupid or am I onto something? I'm pretty much stuck on this part and have been fiddling around with it for waay to long

Submitted July 01, 2019 at 02:00PM by BlacklightBurgundy

No comments:

Post a Comment