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?
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?