DEV Community

Discussion on: Anbody working with MERN? I have error.

Collapse
 
davidfree2 profile image
Humberto David Esquerra

My advice would be to checkout w3schools use of mondgodb. They don't use mongoose they use the official mongodb npm driver. Also try to keep everything in your database.js file and add function arguments to fetch specific collection documents by name. My last advice would be make sure the data your sending to client is a resolved promise. If it isn't a resolved promise your gonna need another call back to resolve the data in the frontend. Good luck! Hang in there!