DEV Community

Cover image for Building an Efficient Chat/Message Feature for My Project: My Progress on Day 90 of #100DaysOfCode
Arash Jangali
Arash Jangali

Posted on

Building an Efficient Chat/Message Feature for My Project: My Progress on Day 90 of #100DaysOfCode

Day 90 of #100DaysOfCode. Back to the project 😍 Today, I continued to work on the chat/message feature, searched for the correct users in the message collection, and retrieved and displayed certain fields of the users, like first name and image URL.

As I delved deeper into the messaging feature of my project, I realized the importance of displaying the correct user information in the chat window. Hence, I spent a significant amount of time searching for the right users in the message collection and retrieving and displaying their first names and image URLs in the chat box.

To achieve this, I had to write a custom query in MongoDB to match the user ID from the message collection with the users' ID in the user collection. Once I was able to retrieve the user data, I passed it as props to the message component, where I could easily display the user's first name and image URL.

I'm excited to see how this feature will improve the overall user experience and make the platform more engaging and user-friendly. In the upcoming days, I plan to work on implementing more features to further enhance the chat and messaging experience.

Stay tuned for more updates on my progress in the coming days!

Top comments (0)