bradtraversy / chatcord

Realtime chat app with rooms
1.18k stars 1.15k forks source link

Chatroom database integration issue #8

Closed kortstin closed 4 years ago

kortstin commented 4 years ago

Hello, I am attempting to integrate a persistent database into the chat room app. I am using MongoDB/Mongoose currently. I have successfully created a data model and can save each message submitted into the database. I am attempting to retrieve them and emit them back onto the frontend. I am able to loop through each found item in the DB collection and socket.emit(), but the message format all comes back undefined. Can anyone help with this? image image