How to Save Data to MongoDB with Node.js for Beginners | EP.5 Build an API with Node.js and Express

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

I am getting “cannot access ‘product’ before initiallization” error how can solve this..

rvlogs
Автор

i used the sample from the github and get this error: Operation `products.insertOne()` buffering timed out after 10000ms

oakz
Автор

I'm lost, when did we created the products folder under Node-API? Please help.

TJPBataller
Автор

const userController = {
registerUser: async (req, res, next) => {
try {
const newUser = await User.create(req.body);

} catch (error) {
res.status(500).json("Tao tài khoản k thành công");
}
},
};
The code always run catch(). But when i just use const newUser = await User(req.body), it's ok. Please help me!

thuannguyenlehoa