Build a Node.js API - tutorial

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


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

Thanks for taking the time to teach us CRUD operations in node. Also, thanks for keeping your lesson short but appropriately informative for a beginner. Blessings!

thegreenroom
Автор

NOTE: db.collection('notes') is now changed to db.db().collection('notes)

boyishi
Автор

Best Tutorial on this topic so far. I find that you are using a very good approach on showing the error and then the solution to it, and the explanation on why did this error happen. Thank's again sir and keep on doing this great work. Greetz from BE

andreipashkov
Автор

22:30 at that point I get the error `db.collection is not a function`. It seems a few things are different with MongoDB Atlas, since mLab doesn't work as presented in the video anymore.


What I needed to do was follow the instructions of MongoDB Atlas to set everything up, then go to Clusters, my created cluster, click 'Connect' > 'Connect Your Application', there's a) the URL we need and, when clicking 'Full Driver Example', I can see why I receive the above error message. With this it seems to work:


const client = new MongoClient(db.url, { useNewUrlParser: true })
client.connect(err => {
if (err) return console.log(err)
const db = client.db("databaseName")
require('./app/routes')(app, db);
app.listen(port, () => {
console.log("We are live on " + port);
});

})


Where databaseName is however you want your database to be called. This way the `db.collection(...)` call within the routes files will work.

MrKohlenstoff
Автор

PostMan chrome extension is now deprecated but the desktop app is working well. Same stuff for Mlab which is now MongoDB =).
Thanks for this tutorial !

marctrentin
Автор

love your content man - thank you for taking the time out of your day to teach us this stuff!

yangyu
Автор

thank you so much for this amazing tutorial

SagarSingh-vfzo
Автор

awesome REST API tutorial...!!! thank you for ending my searching here...!!

sureshsoni
Автор

Thank you for the help, getting started with a self-hosted music server project.

chriszilla
Автор

thank you for a great video , looking forward to watch your future one !

drorgolan
Автор

As of February 2019, mLab does not allow you to create a new account and log in to that account. Instead, you have to use MongoDB Atlas. How can I get my URL from there?

Altanis
Автор

in new versions of mongodb you must use db.db().collection(etc...

troybarnard
Автор

Post-"Mon", lol. Thanks for the tutorial.

Ennui
Автор

If you are having issues with mongodb, as Beau mentioned in the notes: *"NOTE: For this to work correctly, you must use the same version of mongodb. Your package.json file should say: "mongodb": "^2.2.33""*

nahomies
Автор

You may run into an issue where you go from getting 'undefined' for req.body to getting an empty object '{}' - by default Postman seems to send data as form-data - but switching to x-www-form-urlencoded in Postman will give you a populated object.

Mcsqw
Автор

14:56 Can no longer create a mLab account. The site recommends using MongoDB Atlas.

jasoncprince
Автор

how do you connect with VS Code mongdb attachment

jermainegoss
Автор

Great video, totally nailed it🔥🔥can you do a similar tutorial for SOAP api with Nodejs?

oliviabiswas
Автор

I'm sending hello in Postman but I keep getting unexpected <'H' error all the time.Please help

kevinmaina
Автор

What about using mongoose? You can avoid a lot of boilerplate and improve maintenance of the app.

typeof_nan
visit shbcf.ru