Raghul Reerag congratulations. About job interview, how was it, what questions you were asked? I know that this sounds silly, but for a 15 y/o its a life saver. I am so nervous about tech. I know Linux adminstration, I have book on networking that I am reading and I am programming. So if you could explain a little more about your job, your tech stack, interview I'll be very grateful to you.
@@vladimirmikulic7860 just go with your passion , its gonna 100% benefit you. The only thing you have to do is to try being better than yesterday. All the best for all your future endeavors !
my goodness man. I spent my whole week on you youtube channel, was just trying to look up on some school assignment that didn't understand. now just going through all the videos man. can't thank you enough man.
Thanks mentor Brad. Just the time I had a project that needed a rest api on Node and Mongoose here u come with a tutorial. I am loyal to this Channel man..
Good job Brad. I also use JWT as an auth method. I actually don't store it in database but rather send it to the front end as a query string. It's weird but works for my small applications. I used to store it in my MongoDB database but after a while I just got hundreds of JWTs in one single user, because these users don't properly log out.
Originally I thought it was cool that you would do a video on something I was interested in. Now I'm beginning to think you are stalking my browser history. Just yesterday I was looking at what the hell JWT was and boom, here you are with videos. Just don't look at all my browser history ;-), keep broadcasting!!
Brad, another great tutorial! Thank you so much! One minor thing though. When trying to get a customer with not existing id (but the id is in the right format e.g. 5bd870aa926e2e8e82c6d979) you still get 200 status code. I guess it should return 404 not found. If so another check in try/catch is needed. The same goes for update and delete customer. Anyway, it's a great content and I'm looking forward to your next videos!
When using the promise method with .then() do I also need to use .next()? or does the resolve automatically hands over control to the other functions or whatever control gets handed to. I tried it with and without .next() and both ways seem to work, so Im not sure.
Hello, I know I am a bit late to the party, but was trying to do this video as my first nodejs project. With next() no longer being allowed in async calls, how can you get restify-errors to work. I only get 500 returns on bad calls with the async routes.
I love it when someone says "JWT Token" like the T in jwt stands for something else 😂 By the way, thanks for the series Brad it's awesome so far! I feel like I'll be using Restify more now
Thank you very much Brad, your tutorials are always neat and clean that everybody can learn, I have a question that What is the difference between findOneAndRemove and findOneAndDelete?
I am facing an issue. When I am creating username with '@'in mlab like gg@rt1 and password as @123adf, it throws an error on the console --- Unescaped at-sign in authority section. Please help, anyone.
King Traversy. I study Web Programming to make my knowledge official, but most of the actual knowledge have come from your guides here on TH-cam and the in-depth courses on Udemy. I like to watch your Crash Courses on everything and then buy the Udemy Courses for topics that are more relevant to me especially. Any plans on making a course on Serverless with AWS Lambda?
Hey Brad. When dealing with a function with callbacks I've seen you use the .then().catch() syntax but now you went with the async, await, try catch. Is that something you do just for variety? Do you prefer one method over the other? (I think we can all agree the nested callback method is out of the question). Which is the most conventional method that one would see used? Great videos as per usual.
I am not Brad, but both are fine to use, I believe he used async/await in this tutorial just because he said in the beginning of the video that this is a very modern code. So, for this reason he's using async/await which came as a new tool in ES8 the lastest version of JS.
Async await is used to make your code look more synchronous because most people prefer that style. While promise chains are a common pattern in functional programming.
6 ปีที่แล้ว
I've read through mLab's blog posts that they've merged with (or been bought by) MongoDB. Will you eventually make a small tutorial on how to transfer your mLab's databases and collections into MongoDB Atlas?
hey brad, getting this error : MongoError: Authentication failed. at Function.MongoError.create.... have tried several methods to resolve but not working. pls help
Can anyone explain the syntax on line 22? Specifically how encasing it in paraenthesis next to require works. Also, where I can read into it (docs). Thanks.
For the get /customers/:id request. Sometimes (for some long id) mongoose returns null as customer. The try-catch could not catch the error. Then the server just return null for the request.Anyone knows what went wrong with mongoose? Program is exactly like on the video.
And if i use id like the one on the video /customers/1 , that's ok. but if i use a long id like 5bd870e0926e2e8e82c6d973. Sometimes, the server returns null. although most of the time the server can catch the error. i don't know what happened there.
Dig a little deeper, i found that the id should be 12 or 24 long. So when you use 123 as the id, your Try-Catch did catch the error that the id is NOT IN A CORRECT FORMAT. (not because the customer with the id don't exist). And if i use a id with correct format(12 or 24 characters long) then the query returns null, which means (i think) no customer is with that id. And this is where the server should return the customer not found error.
Brad can you do a course about SaaS? I want to sell software online but my "trial users" keep on creating new accounts with fake e-mails, how I can sell my webapp more efficiently to prevent leeches from cheating on my 2-week trial system? Do a course and I'll definitely buy it!
findOneAndRemove() executes the MongoDB db.collection.findAndModify() with remove: true option, while findOneAndDelete() executes MondoDB db.collection.findOneAndDelete(). CheckMongoose API docs: mongoosejs.com/docs/api.html#query_Query-findOneAndDelete (remove is right below)
technically it's and ODM, object document mapper (you are mapping objects to those mongodb documents). ORM maps to relational dbs but here db consists of documents.
Brad how about doing a series with pure nodejs without any framework it's more powerful and no dependence especially for developers who only needs routing I also have to point out using express and other frameworks slows node down by half in most cases trust me it's better to use node as it was intended that's currently my observation and please don't use mongoose these devs should learn how to use the native Mongo driver. That's the issue with javascript too many framework and too many packages most devs won't learn shit I had to learn the hard way.
Can you explain what you mean? It follows the REST architecture. I know definitions can be a little different for different people. I am curious to what you mean though
@@TraversyMedia I'm sorry, I should've said "to me". I use to add URIs to responses objects, because resources are identified by those and the client should not construct/guess the URIs by itself. Also, with POST/PUT/PATCH I always return the object created/updated in the response body, so It's much easier to consume these methods in asynchronous web apps. What do you think?
Thank you brad! You are a major part in my technical life. I ended up with a full time job as a web developer. Thank You soo Much
Raghul Reerag congratulations. About job interview, how was it, what questions you were asked? I know that this sounds silly, but for a 15 y/o its a life saver. I am so nervous about tech. I know Linux adminstration, I have book on networking that I am reading and I am programming. So if you could explain a little more about your job, your tech stack, interview I'll be very grateful to you.
@@vladimirmikulic7860 just go with your passion , its gonna 100% benefit you. The only thing you have to do is to try being better than yesterday. All the best for all your future endeavors !
Raghul Reerag thanks :)
Congrats man, that's awesome
@@TraversyMedia Thank you, you are my man
❤️
my goodness man. I spent my whole week on you youtube channel, was just trying to look up on some school assignment that didn't understand. now just going through all the videos man. can't thank you enough man.
King Brad is back with another astounding tut. Love you man.
Thanks mentor Brad. Just the time I had a project that needed a rest api on Node and Mongoose here u come with a tutorial. I am loyal to this Channel man..
Good job Brad. I also use JWT as an auth method. I actually don't store it in database but rather send it to the front end as a query string. It's weird but works for my small applications.
I used to store it in my MongoDB database but after a while I just got hundreds of JWTs in one single user, because these users don't properly log out.
I had install Mongoose today and the version was 5.3.8, in few hours a new version came up after your tutorial :))
Thank you very much brad, Just because of your tutorials, I am successfully creating production levels apps in nodejs
Wow. I'm more than ready to go on another awesome Node.js adventure with you Brad!
Originally I thought it was cool that you would do a video on something I was interested in. Now I'm beginning to think you are stalking my browser history. Just yesterday I was looking at what the hell JWT was and boom, here you are with videos. Just don't look at all my browser history ;-), keep broadcasting!!
Thanks. As of May 2021, the content is not outdated and useful.
Legend is back. Love you from VN
Brad, another great tutorial! Thank you so much!
One minor thing though. When trying to get a customer with not existing id (but the id is in the right format e.g. 5bd870aa926e2e8e82c6d979) you still get 200 status code. I guess it should return 404 not found. If so another check in try/catch is needed. The same goes for update and delete customer.
Anyway, it's a great content and I'm looking forward to your next videos!
Love you sir from India. Please make more tutorials.
Let me be very frank: I follow Brad Traversy, Maximilian and Steve Colt. I owe them a lot. #BuddingGeek
You should follow Sebastian too. CodingTheSmartWay th-cam.com/channels/LXQoK41TOcIsWtY-BgB_kQ.html
Who is Steve Colt?
You mean Colt Steele?
Just when I was looking for Node REST videos!
Excelente Brad muy buen video, claro y directo al grano.
Is mongoose an ORM? Does it mean it can be used for other NoSQL databases?
Wow, you are one busy person. I respect that...
Graphql? Mobx? Your one of the best teachers out there
Currently watching on my lunch break!
In Kenya (Africa) it's around 9pm
good timing I need this for a job. Thanks brad :)
thank you brad for your amazing effort, i love your all video in you tube & eduonix .
Very useful again .... now need to figure out how to squeeze time to code along. thank you!!!!
Brad, I am always waiting for your videos.
When using the promise method with .then() do I also need to use .next()? or does the resolve automatically hands over control to the other functions or whatever control gets handed to.
I tried it with and without .next() and both ways seem to work, so Im not sure.
Hello, I know I am a bit late to the party, but was trying to do this video as my first nodejs project. With next() no longer being allowed in async calls, how can you get restify-errors to work. I only get 500 returns on bad calls with the async routes.
I was doing CCNA secuirty but damn Brad your videos are too good. #NotificationSquad
I love it when someone says "JWT Token" like the T in jwt stands for something else 😂 By the way, thanks for the series Brad it's awesome so far! I feel like I'll be using Restify more now
haha yeah I guess you have a point :)
Thank you very much Brad, your tutorials are always neat and clean that everybody can learn,
I have a question that What is the difference between findOneAndRemove and findOneAndDelete?
I love this Brad! Thank you so much for this.
It would be great if you could create few series using a SQL db and using sequelizejs.
Yes, actually two sequelize series for MySQL, one for basic syntax (CRUD), then other one for complex operations like joins and using operator aliases
I'm your biggest fan traversy
Please keep up the good work
at first glance, I think I like restify better than express.
MLab seems very similar to MongoDB Compass.Whats the difference apart from one of the the two not requiring instalation on the local machine?
Hell, this is CLUTCH! Thank for this vid!
What is the best way to host a Node.js site? I have a Linux (Ubuntu) VPS with Apache, so is Phusion Passanger the best choice in my case?
What's the view on running mongoDB instance on digital ocean droplet as the server droplet
I am facing an issue. When I am creating username with '@'in mlab like gg@rt1 and password as @123adf, it throws an error on the console --- Unescaped at-sign in authority section. Please help, anyone.
King Traversy. I study Web Programming to make my knowledge official, but most of the actual knowledge have come from your guides here on TH-cam and the in-depth courses on Udemy. I like to watch your Crash Courses on everything and then buy the Udemy Courses for topics that are more relevant to me especially. Any plans on making a course on Serverless with AWS Lambda?
Hey Brad. When dealing with a function with callbacks I've seen you use the .then().catch() syntax but now you went with the async, await, try catch. Is that something you do just for variety? Do you prefer one method over the other? (I think we can all agree the nested callback method is out of the question). Which is the most conventional method that one would see used?
Great videos as per usual.
I am not Brad, but both are fine to use, I believe he used async/await in this tutorial just because he said in the beginning of the video that this is a very modern code. So, for this reason he's using async/await which came as a new tool in ES8 the lastest version of JS.
Async await is used to make your code look more synchronous because most people prefer that style.
While promise chains are a common pattern in functional programming.
I've read through mLab's blog posts that they've merged with (or been bought by) MongoDB. Will you eventually make a small tutorial on how to transfer your mLab's databases and collections into MongoDB Atlas?
Great tutorial! Really easy to follow.
Hi Brad,
I not connect to mongodb
error : MongoParseError, Please help me
hey brad, getting this error : MongoError: Authentication failed.
at Function.MongoError.create.... have tried several methods to resolve but not working. pls help
try to remove "!" from username and pass
Hey Brad, can you also please cover the Unit testing part using Mocha and Chai for this App?
How can I add ejs for frontEnd in a restify application??
Can anyone explain the syntax on line 22? Specifically how encasing it in paraenthesis next to require works. Also, where I can read into it (docs). Thanks.
require is just returning a function name, and you're invoking the function by adding parenthesis (and also passing an argument) after it.
0:1 the come and seep knowledge sound
Thanks, Brad. Thanks for all you do.
How can we create middleware in restify ?
Thanks Brad. You helped me a lot of thing.
For the get /customers/:id request. Sometimes (for some long id) mongoose returns null as customer. The try-catch could not catch the error. Then the server just return null for the request.Anyone knows what went wrong with mongoose? Program is exactly like on the video.
And if i use id like the one on the video /customers/1 , that's ok. but if i use a long id like 5bd870e0926e2e8e82c6d973. Sometimes, the server returns null. although most of the time the server can catch the error. i don't know what happened there.
Dig a little deeper, i found that the id should be 12 or 24 long. So when you use 123 as the id, your Try-Catch did catch the error that the id is NOT IN A CORRECT FORMAT. (not because the customer with the id don't exist). And if i use a id with correct format(12 or 24 characters long) then the query returns null, which means (i think) no customer is with that id. And this is where the server should return the customer not found error.
method POST is not allowed. Any ideas? Thanks
might be a CORS issue. you can check restify-cors-middleware which will allow you to make POST request
Brad can you do a course about SaaS? I want to sell software online but my "trial users" keep on creating new accounts with fake e-mails, how I can sell my webapp more efficiently to prevent leeches from cheating on my 2-week trial system? Do a course and I'll definitely buy it!
Lord Brad at it again
Can you use typeorm in some videos? It is very great and works with different databases :-)
Thanks brad such a amazing video
Thank you dude ! Great tutorial!
I miss you brad!
at first i hit the like button then i watch the video
whats the difference between findoneanddelete and findoneandremove???
findOneAndRemove() executes the MongoDB db.collection.findAndModify() with remove: true option, while findOneAndDelete() executes MondoDB db.collection.findOneAndDelete().
CheckMongoose API docs: mongoosejs.com/docs/api.html#query_Query-findOneAndDelete (remove is right below)
So like, what if I don't want to use Mongo...........
Mongoose is not really an ORM since MongoDB is a non-relational database, right?
technically it's and ODM, object document mapper (you are mapping objects to those mongodb documents). ORM maps to relational dbs but here db consists of documents.
Yes, ODM. I always make that mistake, sorry :(
Thank u for this awesome video and series
Loved NodeJS.
Why are you still using require()?
I don't want to use Babel and I don't like the experimental .mjs. I am waiting for native import in Node
awesome vid, thanks for your effort
Sir can you please make a video on MYSQL ANGULAR NODE.JS , I am looking for those tutorial from so many days ,
Can you please please please do WordPress Headless Rest API with REACT , Please we really need it
How to change timezone in mongoose timestamp
Thank you very much, useful.
Brad how about doing a series with pure nodejs without any framework it's more powerful and no dependence especially for developers who only needs routing I also have to point out using express and other frameworks slows node down by half in most cases trust me it's better to use node as it was intended that's currently my observation and please don't use mongoose these devs should learn how to use the native Mongo driver. That's the issue with javascript too many framework and too many packages most devs won't learn shit I had to learn the hard way.
Im guessing you would recommend the node js masterclass course that teachs pure node, no frameworks, pops up in my adds a lot.
I miss mlab already. So much easier to mess around than that damn cloud @ mongodb. =/
Mongoose supports timestamps out of the box now, just notice
I always use port 9001, because yknow
Love you man... Nothing to say
Amazing video!
I would pay $100 dollar for an in-depth course on Koa. Hook us up brad!
Brad the Man
Really useful, but this is not really RESTful by the way
Can you explain what you mean? It follows the REST architecture. I know definitions can be a little different for different people. I am curious to what you mean though
@@TraversyMedia I'm sorry, I should've said "to me".
I use to add URIs to responses objects, because resources are identified by those and the client should not construct/guess the URIs by itself. Also, with POST/PUT/PATCH I always return the object created/updated in the response body, so It's much easier to consume these methods in asynchronous web apps.
What do you think?
I'm Going to ''module.exports" KUDOS
Awesome thanks.
Thanks man
HELP
Great
Could you make a tutorial on a PHP REST API with oauth2 or token auth?
Angular 7 please Brad
First