I hope that you enjoy this video as much as I did making it. This was my first time using MongoDB and I really enjoyed using it. Nearly 10K Subs!!! Subscribe friends!
I love your work Raddy you are doing a great job but there's something I like to point out if you'll let me. Try to require your modules, create your modules, create your folders and files as you need them or when you need them rather than as you will need them or before you need them, that way it makes it easy for the viewers to understand the need for requiring such module or creating such folder or file at that particular time. By the time you required all the needed modules, create all the needed folders or files at the beginning of your tutorial, it makes it difficult to understand what they do by the time you are using them later in the tutorial. Thanks Raddy for the video I love your work and I hope this makes sense.
I just wanna say thank u. You have immensely helped me in speeding my Node learning at my full time job as I am a new Dev... Again Thanks man really appreciate it!!
So well done! I get so overwhelmed with the flow of NodeJS and knowing how things connect and where they go. You make it seem easy! Great job and great project. I'll definitely be using this!
I would like to thank you so much Raddy, your resources have encouraged me to dive into full-stack development and I am grateful for what I have managed to do within only one month following your Vue js and node js tutorials. However, if you could do a video with a full vue JS & node js app having a frontend and backend panels with user registration, login, and redirecting to admin dashboard with routes protected would be hepful. I am really struggling to put togather all the required resources to make such a full-stack application. Thank you!
Hey, Mukiza! Thanks for the comment. I am thinking about it, but building a full-on registration without cutting corners is a lot of work. I don't mind putting in the work, but it's just finding the time. Thanks for the suggestion, I will look into it
Your content is amazing. I love the fact that your cover different tech like WP, React, Node and Express. This is what I use as well and you videos helped a ton in my journey. Thank a lot and looking forward to future videos.
One of my big worries was that I cover a wide variety of topics. I assumed that most people are here for one thing only. I absolutely love exploring different ways of doing things. It makes web design and development so much more interesting. I am really glad that you think this way and I really appreciate you saying this. Thank you, Simphiwe! I hope that you have a great weekend
Dear Raddy, Thank you very much for your great effort in the elaboration of this magnificent tutorial. It is a complete, simple and very illustrative explanation. THANKS A LOT
I just answered your comment on my blog. The link to the source code is at the bottom of the article. It says "Download on GitHub". You can then download as zip or clone the repo
Your video has been incredibly informative and enlightening. I cannot thank you enough for sharing such valuable insights and knowledge. It has truly been a pleasure learning from you.
throw new Error(msg); ^ Error: Route.get() requires a callback function but got a [object Undefined] this error is occuring when npm start command run please give the solution
This is what I want actaully. Everyone is on for MERN but I want to use EJS. Can you please make a e Commerce video based on ejs, express, node, mongoose but not React.js
Sir your videos are really amazing but can you plz make a video on complete blog system like, User Login/Register, Admin Login, Admin panel for uploading new blogs, same as Wordpress but in NodeJs, Express, mongoDB/mysql and user can apply to become author such type of website sir plzz❣❣❣❣
Thanks, NCV! I would love to do that, but it would take so much time to make and record. It's defiantly something that I am thinking about... thanks for the suggestion and nice comment!
Can u please make it complete with everything...and the functionality that everyone has to login before submitting the recipe or you can say secure admin panel with... I will pay you whatever you demand...
Hey Ali, there is no need to be sarcastic. I am open to feedback and I am always happy to help. I thought that, signing up to MongoDB is straight forward. All you need to do is to click on their Sign In button and register using Google, GitHub or Email. Google and GitHub require one click to sign up. The Email method requires your Email Account, First name, Last name and Password. Enter your details and you should be good to go. I hope this helps :-)
hello sir , You really solved a lot of problems of mine, I just wanted to know when we are displaying specific dishes with routes /categories/thai or any then how is it showing as we have created route of this /categories/:id ?
Hello Raddy, I would like to thank you for making this video because the video really helped me. but I want to ask why the image in my coding can't be set to be smaller? the image exceeds the container
MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string. please help me i am getting this error
Amazingly helpful & great work! I was just wondering if anyone could drop the code that would make one able to update and delete recipes from the app itself, and not the code? Would be greatly appreciated but other than that, great job!
Hi Raddy, I'm having some issues with the MongoDB/Categories part. I've managed to set up the connection (the Recipes database and Categories collection appears in my MongoDB account, but it is empty and there is no data), but it stops working for me during the dummy category data stage. I've looked over the video and code in the GitHub files multiple times, but I can't seem to figure out where it's going wrong. Do you have any idea what might be happening? Thanks in advance :)
It's kind of tricky to explain but I will try. To update a record you need to create a form with all fields required. You have to do a query to the database and pull the record data that you wish to update. Use that data to populate the fields. Once the fields are there you can use the form to post the data back and use the updateOne method. Next time I make a video with MongoDB I will include everything for sure
Actually my mongodb is not getting connected the following error is coming please solve this connection error: MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
With Handlebards is a little bit easier. You can do: {{#if categories}} {{/if}} If you want to do a loop you can do: {{#each categories}} {{this.name}} {{/each}}
I'm getting an error on category.js. "TypeError: mongoose.model is not a function". Followed all your steps exactly and compared it to your git. Can't see what's wrong here.
Hey Alfia, files usually have an extinction behind them. Anything with .ejs, js, css and so on are the files. The top-level folder are "public, server, views" and inside them, we have a few more such as layouts, controllers, models, routes and so on. I hope this helps
Great video, I'm creating an article website but can't figure out how to store articles and how to create them to submit, since articles have different structures and image placements, hope you can help
It would be more or less the same. You could have a "Posts" table and that table would have fields such as Title, Slug, Thumbnail, Body, Category and so on... One thing that I would suggest is to add a "slug" so you have friendly URL's for your articles. I am considering doing a video on it
@@RaddyDev what i mean that one article can have 10 images while other articles have only one or two , or 7 and so on How can i create a sumbit system that can adapt to this I was thinking of storing the images in an outside storage and submit html code with the images links to store it in the db
That makes sense. Store the images anywhere you like and just store the names in your DB. I guess it depends on where you want to store the images. You'll have to follow their instructions and the database bit will be exactly the same as the video.
This is very helpful. I am having a hard time using the update method with forms.. I have no idea how to use the code that you mentioned at the end of the video.
Hey Mark, let's say that you create an update-recipe page. That page will have an HTML Form with all the fields required for the recipe. The idea is that you can go to the database, grab a recipe by id and populate the fields from the database. Now that you have the HTML inputs with the data in them, you can manually update them by writing whatever you want. The next bit is where you click submit and the data is posted to the server. This is where the update query example kicks in. It's kind of hard to properly explain, but I hope this helps. I do have another tutorial which shows how the update works, but it's using SQL instead. I will need to create something soon to show everything
Please reply asap On inserting data to mongodb by using category.insertMany() function, it's showing "listening to port 3000 but err NaN" I'm not able to create databse and collection on cluster. Help me out.
I have the feeling that this comes from your search query. Can you double check it, as you might not be passing the search term properly. Maybe a typo...
Hey, I am getting error of port not defined in app.js. And I have also copied your app.js then also it is showing error, port not defined. Please help me!
That's strange. So do you have: const port = process.env.PORT || 3000; app.listen(port, ()=> console.log(`Listening to port ${port}`)); in your app.js? You could try different port number
Can someone help me, I have a problem when insermany it uploads it to the mongodb but the array is empty eventhough I put in array of strings inside ingrididents
Hey, are you trying to insert the Dummy demo data? You can copy the array and insert it all from MongoDB. That would be much easier and also it will tell you if you have any errors in the in your json
As far as I know, Netify is only for static sites. There is an option for Cloud Functions that should work if you want to make an API, but since this project is using EJS I don't think that it's going to work. Heroku is an option. They have a free tier for personal projects
this ( connection error : MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string if ur getting this error just go to servre->models->database.js->replace env.mongodb with ur mongodb url there itself
How would you be able to add a way to have the user submit the recipe form, have it come to you, and approve or deny the submission rather than it automatically posting? I love the video by the way!
To start with you have to create a form with fields matching the Recipe Schema. The idea is that on submitting the form you grab the data from the inputs and save them into the database. Just like we used the .find() method in this tutorial, you can use .create() and insert data. For approval, you could have a status filed for the recipe. On submit, the default status could be "pending". Then the easiest way would be to do it from the database, otherwise, you'll have to build the admin menu. You don't want everybody to be able to approve. Then you have to change your display recipes query to only display recipes that have the status of "approved". That's the theory. I have done two new tutorials where there is a form submission. You can skip to that part or look into the code on GitHub. One is creating the new "CRUD user management system..." and the other one is "build a notes app using nodejs...."
That's very generic and and it's hard to tell. Could you be a little bit more specific, when does it happen - which peace of code creates the error? Hopefully I'll be able to point you in the right direction. Also the code is available on github for you to reference
It's unfortunate you didn't include to recipe schema you used and the files for the upload folder. Makes things more challenging to follow along at any pace. Not impossible just a bit of a frustration.
I was doing a project kinda like this one but I use JSON as my database I do the search part it got an error 2:06:40 it was not working, does anyone know why?
Since you are using a JSON as a DB, you will have to use another approach to search. The "find()" function is a filter specific to Mongoose. You will have to build your own find in JSON script. I think that there are a lot of simple-ish examples on the internet
I am facing a problem how can i get the data for each dish like the Ingredients, email, image, category, etc. I am unable to get that data, can you please help me in getting that. Would really Appreciate.
Of course. What is happening? Do you get any errors? The Github repo is linked in the description of the video if you wish to reference and double check the code
Great tutorial and easy to understand, thank you. Wondering what the best way would be to incorporate hyperlinks for the content in the description field. Do you think this can be done directly in MongoDB?
Thanks, Gred! Yes, absolutely it's possible. Nothing stops you from allowing HTML to be inserted into your DB. You can use express validator and sanitize HTML to clean it up before it goes into the database, but I am not sure how effective that would be. It might be okay depending on what you do
Hello! Can you help me please, that what will be the problem for me? When you click at 1:50:20 to the recipe, my page is loading for the infinity, not loading to the recipe page. After if i put the next code to the recipe.ejs what you have at 1:51:18 then i got a message: {"message":"fn is not a function"}. Did you know, what will be the problem for that? Is something missing for me to install in the powershell? Thanks before you help, aweseom project!
That's a strange one. I was just looking online and someone on StackOverflow suggest installing the latest Node.js. npm install -g npm stable npm install -g node If you go on the link in the description that will lead you to my blog and GitHub. Have a look at the code I've got and hopefully that would help
@@RaddyDev Thank you for the reply! I tried to do this, but i started this project 2 days ago so i have the latest one. But at this time I tried with your code, i downloaded from github, made the .env file with the connection to mongodb and now its working fine, so it should be my mistake, i will try to fix it with your code. Thank you to sharing with us, helping me a lot with this, keep going! :)
Hello Raddy sir, At 1:05:18 i am gettinf error of this ( connection error : MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.) plz help i am struggling from 5 hours.
Hey Vishal, the error is saying that MongoDB is not getting the connection string. The reason for that could be that you haven't configured .env or you have a typo. Make sure that you have MONGODB_URI= (remove any spaces) and then mongoose.connect(process.env.MONGODB_URI ... You can try: mongoose.connect(process.env.MONGODB_URI
You'll need to add them manually through the database. You can make an admin panel with forms to add, update and delete, but obviously that would require a bit of work. You'll need some sort of a login system as well, unless you make a separate dashboard that you can run locally. I normally make an MVP and then work on the admin stuff later on as sometimes fileds/data can change (unless you plan well).
@dimitardenev2817 I did one for the NetNinja last year. It's fairly basic, but it does the job I guess github.com/RaddyTheBrand/25.NodeJs-Express-EJS-MongoDB--Blog
@@RaddyDev actually my mongodb is not getting connected the following error is coming please solve this connection error: MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
It's very popular today, and my guess would be that is only going to grow. Have a look at the Stack Overflow Developer Survey 2021, it's quite interesting
Anyone else running into this error: node:internal/modules/cjs/loader:936 throw err; I've gone crazy trying to figure it out. Even went and downloaded his git file, but STILL ran into the error while trying to use nodemon start. Any tips?
You can find all of the images inside the GitHub Repo. If you click on the GitHub link in the description, you can go under 'public/img' and see them there. You could download the entire project and just pick the images that you want. Additionally I have added an editable PSD version of the Hero image - also link in description.
Not on this one. I've made other projects with edit and delete that you could check out. The Notes one has all that good stuff ruclips.net/video/BDo1lgaZuII/видео.html&lc=UgzjYzNW9El3tdQkWXZ4AaABAg
Hello sir, While connecting MongoDB to node.js application i am getting this error in node_modules folder Error : => this.options = options ?? {} Any solution for this ?
That's a strange one. You could install the latest NodeJs, then remove the node_modules folder and install again. See if that solves the problem. You should be able to do "npm install" in your main root.
@@RaddyDev I am using windows 7 So I can install node.js version till 13.14 if I upgrade it won't works, my current version is 13.14. While connecting mongoDB through the Mongoose this error appears
You could try using a browser IDE like Replit. You can get a free account and run the latest NodeJs on their editor. The other option would be to install Windows 10 or something like Ubuntu. It's a tough one... Replit is a good option :)
@@mrmasonclashroyale9447 Your problem might be the Schema Index. In models - Recipe.js check if you have the following: recipeSchema.index({ name: 'text', description: 'text' }); I hope this works for you
Did you set up your database and create the .env file with the credentials? .env MONGODB_URI = mongodb+srv://:@cluster0.1234.mongodb.net/Recipes?retryWrites=true&w=majority
@@saurabhprasad That's strange because the error suggest that you haven't got them. Make sure your ENV is working. Maybe console log some dummy data out of it
So i was able to rectify the problem, so if have dat error message all u need to do is got to ur Category file . //At the beginning const Schema = new mongose. Schema //And at the end of the Code const Category = mongoose. model("Category",categorySchema ) module. exports = Category
Hi Raddy, I am getting this error - istening to port 3000 error connecting to db MongoServerSelectionError: connection to closed.. Please do help out..Plsss
Some of the packages have been updated and there are a few small braking changes. Nothing that you can't fix easily. I do try to keep the Github Repo up to date as much as I can. Everything is commented so you'll be able to see the small changes
bro can you help me actually my mongodb is not getting connected the following error is coming please solve this connection error: MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
The structure might be on the Github repo. I'll have a look for the data, maybe I can zip it and upload it. I didn't want to have it online as obviously it was taken from jamie oliver's website. You can just use lorem ipsum :)
hello, please anyone help me i am facing some problem Listening to port 3000 connected err NaN like this. and I am refreshing then no data show in my desktop How I solve this problem. please reply.
}catch(error){ console.log('err', error.message) } } insertDymyCategoryData(); after inserting the data this problem throw? before inserting data this will work properly. and as well as this will not show the data in mongodb atlas. after refreshing this how to solve this error: Dejal D Bisen 1 day ago hello, please anyone help me i am facing some problem Listening to port 3000 connected err NaN
I hope that you enjoy this video as much as I did making it. This was my first time using MongoDB and I really enjoyed using it. Nearly 10K Subs!!! Subscribe friends!
I love your work Raddy you are doing a great job but there's something I like to point out if you'll let me. Try to require your modules, create your modules, create your folders and files as you need them or when you need them rather than as you will need them or before you need them, that way it makes it easy for the viewers to understand the need for requiring such module or creating such folder or file at that particular time. By the time you required all the needed modules, create all the needed folders or files at the beginning of your tutorial, it makes it difficult to understand what they do by the time you are using them later in the tutorial. Thanks Raddy for the video I love your work and I hope this makes sense.
@@zackOverflow Thanks, Zack! It makes sense and it's a valid point. I am glad that you said it. Thank you!
my code doesn't work. actually after render static files doesn't work
@@sarvarbekkhamidullayev1325 What is the error that you get?
how can i get the dymmydata please ....which website did you copy it from
I normally don't comment on videos but mannn this tutorial is awesome. I learnt a lot of new stuff like connect-flash and ejs-layout. Excellent!
Glad you liked it and thanks for the support! Comments are helpful for smaller creators like myself
this is the tutorial i was loking for so long.... i can't thank u enough for this video
A nice comment like this is good enough for me. Thank you and I am glad that you found the video. I hope that you find it useful
I just wanna say thank u. You have immensely helped me in speeding my Node learning at my full time job as I am a new Dev... Again Thanks man really appreciate it!!
Glad to hear that the tutorials are helping! I hope that you enjoy your job and have a successful career 👊😎
So well done! I get so overwhelmed with the flow of NodeJS and knowing how things connect and where they go. You make it seem easy! Great job and great project. I'll definitely be using this!
I would like to thank you so much Raddy, your resources have encouraged me to dive into full-stack development and I am grateful for what I have managed to do within only one month following your Vue js and node js tutorials. However, if you could do a video with a full vue JS & node js app having a frontend and backend panels with user registration, login, and redirecting to admin dashboard with routes protected would be hepful. I am really struggling to put togather all the required resources to make such a full-stack application. Thank you!
Hey, Mukiza! Thanks for the comment. I am thinking about it, but building a full-on registration without cutting corners is a lot of work. I don't mind putting in the work, but it's just finding the time. Thanks for the suggestion, I will look into it
@@RaddyDev Thank you a lot. I can't wait for that.
Your content is amazing. I love the fact that your cover different tech like WP, React, Node and Express. This is what I use as well and you videos helped a ton in my journey. Thank a lot and looking forward to future videos.
One of my big worries was that I cover a wide variety of topics. I assumed that most people are here for one thing only. I absolutely love exploring different ways of doing things. It makes web design and development so much more interesting. I am really glad that you think this way and I really appreciate you saying this. Thank you, Simphiwe! I hope that you have a great weekend
Dear Raddy,
Thank you very much for your great effort in the elaboration of this magnificent tutorial.
It is a complete, simple and very illustrative explanation.
THANKS A LOT
Thanks for the nice words, Eduardo! I appreciate it
can u please send me the source code link..?
I just answered your comment on my blog. The link to the source code is at the bottom of the article. It says "Download on GitHub". You can then download as zip or clone the repo
for those who have layout problem in the "Main Layout" section: Just change tag with . it worked for me.
Hey Raddy, really appreciate your effort and quality tutorials. Thanks a lot!
Glad you like them!
I've been looking for a project that ties all my current learning, and this is just perfect. Thank you
Glad it was helpful!
Your video has been incredibly informative and enlightening. I cannot thank you enough for sharing such valuable insights and knowledge. It has truly been a pleasure learning from you.
Thank you, Buraxta. Happy to hear that you found the tutorial informative
Thank you for the fantastic tutorial! Your explanations and examples helped me build the project without any problems. Much appreciated! 👏
Hey Raddy, really appreciate your effort and quality tutorials. Thanks you brother
I appetite you saying that, Ayoub. Much appreciated
Excellent tutorial, I cannot thank you enough for how much you've helped me. Instant subscribe!
Thank you so much I was looking for such project from many time 😊
Finally what I was looking for
Glad to hear that, Sizwe!
This really worth for me !!! thank you dear sir for a amazing tutorial. Thanks a lot
Glad to hear that
Awesome work, really appreciate your efforts ♥♥
Thank you, Mainul! I appreciate your comment
throw new Error(msg);
^
Error: Route.get() requires a callback function but got a [object Undefined]
this error is occuring when npm start command run please give the solution
Thanks you sir, you really do a great work.
God will reward you sir
Thank you, Master Wave! I appreciate that
Thanks a lot for this helpful content! ❤❤👏👏
Thank you, glad that you found it helpful! 🔥
Amazing tutorial! Thank you so much for this content
Thanks for your efforts!
Absolutely incredible! Thank you so much and Keep going on 😄
Thank you! Will do!
Thank you so much bro, I really appreciate your content
This helped me a lot! thanks!
Glad it helped!
This is what I want actaully. Everyone is on for MERN but I want to use EJS. Can you please make a e Commerce video based on ejs, express, node, mongoose but not React.js
Raddy your blog recipe video helpfull for my website create Thanks.
Sir your videos are really amazing but can you plz make a video on complete blog system like, User Login/Register, Admin Login, Admin panel for uploading new blogs, same as Wordpress but in NodeJs, Express, mongoDB/mysql and user can apply to become author such type of website sir plzz❣❣❣❣
Thanks, NCV! I would love to do that, but it would take so much time to make and record. It's defiantly something that I am thinking about... thanks for the suggestion and nice comment!
@@RaddyDev Thank You sir💯🙈🙈
@@RaddyDev I really have the same request. That would be helpful for us to dive into full-stack development.
Can u please make it complete with everything...and the functionality that everyone has to login before submitting the recipe or you can say secure admin panel with...
I will pay you whatever you demand...
I really like your tutorial^^
Thank you! Cheers!
awesome
Thank you very much, I loved the video
Glad you enjoyed it!
Thank you
You're welcome
Hi raddy, what a nice tuto !! Thanks, can you tell me which theme you are using ??
Thanks, Ahmed! The theme I am using is called Dracula. It's the free version
How to add delete and update recipe option to this
Dope content 🔥🔥🔥
Thank you!
Can you also add the feature of google sign up & adding a saved recipes page please along with the feature to share it?
I probably won't be adding more features to thing project, but I'll have those features in mind for future ones
thank you so much explaining in detail how to register an account for mongodb.
ps this is sarcasm
Hey Ali, there is no need to be sarcastic. I am open to feedback and I am always happy to help.
I thought that, signing up to MongoDB is straight forward. All you need to do is to click on their Sign In button and register using Google, GitHub or Email. Google and GitHub require one click to sign up.
The Email method requires your Email Account, First name, Last name and Password. Enter your details and you should be good to go.
I hope this helps :-)
Amazing thank you
hello sir , You really solved a lot of problems of mine, I just wanted to know when we are displaying specific dishes with routes /categories/thai or any then how is it showing as we have created route of this /categories/:id ?
Hello Raddy, I would like to thank you for making this video because the video really helped me. but I want to ask why the image in my coding can't be set to be smaller? the image exceeds the container
It could be because of the node modules folder. Normally that's installed when you deploy
MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string. please help me i am getting this error
hey i got it too, did you fix it?
move the. .env file to the root file i.e in the CookingBlog project folder and not in the views folder
does anyone fix it already :( help me
Create the .env file in the root directory and add the mongodb URL
thanks💌
do you know how to making delete and update by pressing button on that recipe blog . i've been trying to make it but always fail
Thank you so much, it helps me a lot, but could you let me know how to use the cloud to save images that the user uploads? Especially Cloudinary
Oh, I did my own research and succeeded
Amazingly helpful & great work! I was just wondering if anyone could drop the code that would make one able to update and delete recipes from the app itself, and not the code? Would be greatly appreciated but other than that, great job!
Hi Raddy, I'm having some issues with the MongoDB/Categories part. I've managed to set up the connection (the Recipes database and Categories collection appears in my MongoDB account, but it is empty and there is no data), but it stops working for me during the dummy category data stage.
I've looked over the video and code in the GitHub files multiple times, but I can't seem to figure out where it's going wrong. Do you have any idea what might be happening? Thanks in advance :)
Did you add your IP to the Network Access page? Could you log out any errors. Hopefully the errors will give you an indication of what is happening
Images do not display from database..
Where can you find the mongodb docs that show you code that can be run in js scripts. I can only find shell and mongosh documentation.
Hello, Try - mongoosejs dot com/docs/
hello, that was awesome, but i need the update Recipe? how can i get them>
thank you Raddy
It's kind of tricky to explain but I will try.
To update a record you need to create a form with all fields required. You have to do a query to the database and pull the record data that you wish to update. Use that data to populate the fields. Once the fields are there you can use the form to post the data back and use the updateOne method. Next time I make a video with MongoDB I will include everything for sure
Actually my mongodb is not getting connected the following error is coming please solve this
connection error: MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
Make sure that you are using this format in your ENV: MONGODB_URI = mongodb+srv://:@cluster0.7oacavx.mongodb.net/MyDatabaseName
@@RaddyDev Yeah I had make sure that i am using this format only even though its not working i had check so many times.Same error Occuring
@@omkarmore1170 same bro did you got the solution pls help me to
Copy the exact same string that mongodb gives you and replace the password
@@RaddyDev alreday did it m still getting same error
please do another web app video like this. this tutorial is very nice
Thank you, I will do that!
Sir More like this with blog website please sir upload that 🙏🏻♥️
Glad that you like it! I am definitely looking forward to make more projects like it
@@RaddyDev thank you sir ♥️
Hey Abhishek ! Have you made a projects lately with react ? Are you open to internship/job opportunities currently ?
Hi, how can we do this using handlebars. For example, the category if condition in 1:20:00. handlebars not has a if condition like ejs
With Handlebards is a little bit easier. You can do:
{{#if categories}}
{{/if}}
If you want to do a loop you can do:
{{#each categories}}
{{this.name}}
{{/each}}
I'm getting an error on category.js. "TypeError: mongoose.model is not a function". Followed all your steps exactly and compared it to your git. Can't see what's wrong here.
I will look into this later on today to see if I can help
Hey i am confused in the beginning part the folders and files part unable to understand which are folders and which are files please explain
Hey Alfia, files usually have an extinction behind them. Anything with .ejs, js, css and so on are the files. The top-level folder are "public, server, views" and inside them, we have a few more such as layouts, controllers, models, routes and so on. I hope this helps
Great video, I'm creating an article website but can't figure out how to store articles and how to create them to submit, since articles have different structures and image placements, hope you can help
It would be more or less the same. You could have a "Posts" table and that table would have fields such as Title, Slug, Thumbnail, Body, Category and so on... One thing that I would suggest is to add a "slug" so you have friendly URL's for your articles. I am considering doing a video on it
@@RaddyDev what i mean that one article can have 10 images while other articles have only one or two , or 7 and so on
How can i create a sumbit system that can adapt to this
I was thinking of storing the images in an outside storage and submit html code with the images links to store it in the db
That makes sense. Store the images anywhere you like and just store the names in your DB. I guess it depends on where you want to store the images. You'll have to follow their instructions and the database bit will be exactly the same as the video.
This is very helpful. I am having a hard time using the update method with forms.. I have no idea how to use the code that you mentioned at the end of the video.
Hey Mark, let's say that you create an update-recipe page. That page will have an HTML Form with all the fields required for the recipe. The idea is that you can go to the database, grab a recipe by id and populate the fields from the database. Now that you have the HTML inputs with the data in them, you can manually update them by writing whatever you want. The next bit is where you click submit and the data is posted to the server. This is where the update query example kicks in. It's kind of hard to properly explain, but I hope this helps. I do have another tutorial which shows how the update works, but it's using SQL instead. I will need to create something soon to show everything
Uhh how do I may add more categories in the future like lets say Bulgarian or Japanese? Also Thank you very much for the useful tutorial :D!
Благодаря за коментара. За сега няма административна страница, но с малко усилия нещата ще станат.
Please reply asap
On inserting data to mongodb by using category.insertMany() function, it's showing "listening to port 3000 but err NaN"
I'm not able to create databse and collection on cluster.
Help me out.
Send me your rep
You can go to MongoDB and insert the data from there as JSON if that helps
hello raddy whats this error {"message":"text index required for $text query"}
I have the feeling that this comes from your search query. Can you double check it, as you might not be passing the search term properly. Maybe a typo...
Hey, I am getting error of port not defined in app.js. And I have also copied your app.js then also it is showing error, port not defined. Please help me!
That's strange. So do you have:
const port = process.env.PORT || 3000;
app.listen(port, ()=> console.log(`Listening to port ${port}`));
in your app.js? You could try different port number
the best
I appreciate it, Abdul. Thank you for watching
Can someone help me, I have a problem when insermany it uploads it to the mongodb but the array is empty eventhough I put in array of strings inside ingrididents
Hey, are you trying to insert the Dummy demo data? You can copy the array and insert it all from MongoDB. That would be much easier and also it will tell you if you have any errors in the in your json
Hey, first of all thanks for this great project. I love it.
I have one question. Is it possible to deploy this project to Netlify ?
As far as I know, Netify is only for static sites. There is an option for Cloud Functions that should work if you want to make an API, but since this project is using EJS I don't think that it's going to work. Heroku is an option. They have a free tier for personal projects
hey today i was deploying the project on heroku but got many errors . were u able to host it ?? if so ,, pls tell me how to solve this
this ( connection error : MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string
if ur getting this error just go to servre->models->database.js->replace env.mongodb with ur mongodb url there itself
same is with me did you got the solution ?if you did help me bro
Really good work...but it'd be better if you show some kind of flowchart for the entire project...its not easy to picture the concept
Thank you and I totally agree. I will do that next time - thank you for the feedback
No issues brother....
How would you be able to add a way to have the user submit the recipe form, have it come to you, and approve or deny the submission rather than it automatically posting? I love the video by the way!
To start with you have to create a form with fields matching the Recipe Schema.
The idea is that on submitting the form you grab the data from the inputs and save them into the database.
Just like we used the .find() method in this tutorial, you can use .create() and insert data.
For approval, you could have a status filed for the recipe. On submit, the default status could be "pending". Then the easiest way would be to do it from the database, otherwise, you'll have to build the admin menu. You don't want everybody to be able to approve. Then you have to change your display recipes query to only display recipes that have the status of "approved". That's the theory.
I have done two new tutorials where there is a form submission. You can skip to that part or look into the code on GitHub. One is creating the new "CRUD user management system..." and the other one is "build a notes app using nodejs...."
err NaN
listening to port 3000,i get this error after inserting my dummy data and i cant find the error
That's very generic and and it's hard to tell. Could you be a little bit more specific, when does it happen - which peace of code creates the error? Hopefully I'll be able to point you in the right direction. Also the code is available on github for you to reference
Hi raddy if we follow same process as you told and do this website in our system is it work or not
What system is it?
I want to deploy this project, how can i deploy it , someone can help me?
Hi raddy why is this error ? -> {"message":"Operation `categories.find()` buffering timed out after 10000ms"}
I wonder if you need to put categories.find({}). Can you show me your code where you think this is coming from?
@@RaddyDev
exports.homepage = async(req,res) =>{
try {
const limitNumber = 5;
const categories = await category.find({}).limit(limitNumber);
res.render('index', {title: 'Cooking Blog - Home',categories});
} catch (error) {
res.status(500).send({message:error.message || "Error Ocured"})
}
}
It's unfortunate you didn't include to recipe schema you used and the files for the upload folder. Makes things more challenging to follow along at any pace. Not impossible just a bit of a frustration.
I understand... I will try to find royalty free alternatives and upload them including the data :)
I've uploaded new images and the MongoDB data in the main repo 🙂
2:29:49 couldn't we just loop through the category collection and get the name of each category?
Yeah you can do. That's actually a pretty good idea, it makes everything a little bit more dynamic instead of having to change it manually.
Much better if you added button for edit update
I was doing a project kinda like this one but I use JSON as my database I do the search part it got an error 2:06:40 it was not working, does anyone know why?
Since you are using a JSON as a DB, you will have to use another approach to search. The "find()" function is a filter specific to Mongoose. You will have to build your own find in JSON script. I think that there are a lot of simple-ish examples on the internet
I am facing a problem how can i get the data for each dish like the Ingredients, email, image, category, etc. I am unable to get that data, can you please help me in getting that. Would really Appreciate.
Of course. What is happening? Do you get any errors? The Github repo is linked in the description of the video if you wish to reference and double check the code
Getting error my db is not connecting
Great tutorial and easy to understand, thank you. Wondering what the best way would be to incorporate hyperlinks for the content in the description field. Do you think this can be done directly in MongoDB?
Thanks, Gred! Yes, absolutely it's possible. Nothing stops you from allowing HTML to be inserted into your DB. You can use express validator and sanitize HTML to clean it up before it goes into the database, but I am not sure how effective that would be. It might be okay depending on what you do
Hello! Can you help me please, that what will be the problem for me? When you click at 1:50:20 to the recipe, my page is loading for the infinity, not loading to the recipe page. After if i put the next code to the recipe.ejs what you have at 1:51:18 then i got a message: {"message":"fn is not a function"}. Did you know, what will be the problem for that? Is something missing for me to install in the powershell? Thanks before you help, aweseom project!
That's a strange one. I was just looking online and someone on StackOverflow suggest installing the latest Node.js.
npm install -g npm stable
npm install -g node
If you go on the link in the description that will lead you to my blog and GitHub. Have a look at the code I've got and hopefully that would help
@@RaddyDev Thank you for the reply! I tried to do this, but i started this project 2 days ago so i have the latest one. But at this time I tried with your code, i downloaded from github, made the .env file with the connection to mongodb and now its working fine, so it should be my mistake, i will try to fix it with your code. Thank you to sharing with us, helping me a lot with this, keep going! :)
Hello Raddy sir,
At 1:05:18 i am gettinf error of this ( connection error : MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.) plz help i am struggling from 5 hours.
Hey Vishal, the error is saying that MongoDB is not getting the connection string. The reason for that could be that you haven't configured .env or you have a typo. Make sure that you have MONGODB_URI= (remove any spaces) and then
mongoose.connect(process.env.MONGODB_URI ...
You can try: mongoose.connect(process.env.MONGODB_URI
Thank u Sir it worked but now data is not inserting into mongodb Recipe database
You can try to get the data and insert it manually into That's a good option. Look around for an "insert" button when you browse the database
the images which are in github are giving some issue when we want to download the images.
What happens? There is a file inside public/uploads containing the photo credits with the links. Maybe try downloading them from there
@@RaddyDevunable to download the images of img and upload folder .
@@animesh414 That's strange. Try downloading from the credits. Or I could upload them somewhere else as well
If I may inquire? How would be possible to add more categories in the future? Thank you !
You'll need to add them manually through the database. You can make an admin panel with forms to add, update and delete, but obviously that would require a bit of work. You'll need some sort of a login system as well, unless you make a separate dashboard that you can run locally. I normally make an MVP and then work on the admin stuff later on as sometimes fileds/data can change (unless you plan well).
@@RaddyDev how would i be able to integrate a simple login system into this blog?
@dimitardenev2817 I did one for the NetNinja last year. It's fairly basic, but it does the job I guess github.com/RaddyTheBrand/25.NodeJs-Express-EJS-MongoDB--Blog
@@RaddyDev actually my mongodb is not getting connected the following error is coming please solve this
connection error: MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
Can u say me, how popular is node.js today, and how popular will be in future ? Is it good option to learn
It's very popular today, and my guess would be that is only going to grow. Have a look at the Stack Overflow Developer Survey 2021, it's quite interesting
@@RaddyDev I see that express is on third place of most popular web frameworks. Its good, i like node and express very much
Anyone else running into this error: node:internal/modules/cjs/loader:936 throw err; I've gone crazy trying to figure it out. Even went and downloaded his git file, but STILL ran into the error while trying to use nodemon start. Any tips?
It sounds like you need to cd to your project folder and then run the project. If you are on Linux you might have to run it as an admin using sudo
and what is lazy loading...why it is..
I unable download hero-image.png ,view-all .jpg ,publish-recipe.png plz provide
You can find all of the images inside the GitHub Repo. If you click on the GitHub link in the description, you can go under 'public/img' and see them there. You could download the entire project and just pick the images that you want. Additionally I have added an editable PSD version of the Hero image - also link in description.
Is there a edit and delete. Function?
Not on this one. I've made other projects with edit and delete that you could check out. The Notes one has all that good stuff ruclips.net/video/BDo1lgaZuII/видео.html&lc=UgzjYzNW9El3tdQkWXZ4AaABAg
Hello sir,
While connecting MongoDB to node.js application i am getting this error in node_modules folder
Error :
=> this.options = options ?? {}
Any solution for this ?
That's a strange one. You could install the latest NodeJs, then remove the node_modules folder and install again. See if that solves the problem. You should be able to do "npm install" in your main root.
@@RaddyDev I am using windows 7 So I can install node.js version till 13.14 if I upgrade it won't works, my current version is 13.14. While connecting mongoDB through the Mongoose this error appears
You could try using a browser IDE like Replit. You can get a free account and run the latest NodeJs on their editor.
The other option would be to install Windows 10 or something like Ubuntu.
It's a tough one... Replit is a good option :)
@@RaddyDev ok thank you 👍
I am not seeing Update and Delete Button...
Yeah, that's cool. Customise it the way you like and suits your needs 🙂
i am stuck with this video I dont know now how can I add login and register. using all the files here.
also i dont know why I cant add recipe on Spanish I dont know why.
That's strange. What happens when you try Spanish?
@@checkerface5710 did you add 'Spanish' as an option in the enum array?
Search form doesn't work.I did it like in your tutorial.Could you help me
error: {"message":"text index required for $text query"}
@@mrmasonclashroyale9447 Your problem might be the Schema Index. In models - Recipe.js check if you have the following: recipeSchema.index({ name: 'text', description: 'text' });
I hope this works for you
@@RaddyDev doesn't work
@@mrmasonclashroyale9447 hey did you find the answer of this ?
connection error: MongoAPIError: URI must include hostname, domain name, and tld..//pls help me
Did you set up your database and create the .env file with the credentials?
.env
MONGODB_URI = mongodb+srv://:@cluster0.1234.mongodb.net/Recipes?retryWrites=true&w=majority
@@RaddyDev yes database and the .env file will be set up but still not working..//so pls help me
@@saurabhprasad That's strange because the error suggest that you haven't got them. Make sure your ENV is working. Maybe console log some dummy data out of it
Brother resolved this error I am also facing same error
I am having an issue which is Category. insertMany is not a function
If you are inserting multiple records you need to wrap them in brackets " [ ] ". insertMany ([ { name:"raddy"},{name:"daniel" }])
i was able to to solve it now having Category. find is not a function. After inserting the Data into the database it.
So i was able to rectify the problem, so if have dat error message all u need to do is got to ur Category file .
//At the beginning
const Schema = new mongose. Schema
//And at the end of the Code
const Category = mongoose. model("Category",categorySchema )
module. exports = Category
Hi Raddy, I am getting this error - istening to port 3000
error connecting to db MongoServerSelectionError: connection to closed.. Please do help out..Plsss
Do we need mongosh for this?
or this --> $ brew install mongodb-atlas-cli
$ atlas setup ??
Your comment was put in spam because of the IP you posted 😀 I think that you just need to add your IP in MongoDB
@@RaddyDev Just edited it 😅 Didn't realise I left it in the comment. Thanks Raddy!
Having a error, connection result err nan
That's a strange one. Is there any way you can share your code? Maybe you are trying to convert err to a number with a plus sign in from of it
Hey Raddy. This video was uploaded on 30 set 2021 and now in 2024 this project is working fine?
Some of the packages have been updated and there are a few small braking changes. Nothing that you can't fix easily. I do try to keep the Github Repo up to date as much as I can. Everything is commented so you'll be able to see the small changes
Just finished it and it was worth any minute. Thanks a lot ma broda@@RaddyDev
Have you completed the project completely, i have been encountering errors here and there, would you mind helping me.
@@tejaraju4793 Yes. It worked just fine here. No problems at all. What's up?
bro can you help me actually my mongodb is not getting connected the following error is coming please solve this
connection error: MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
can u give me recipe table data?i can't found
The structure might be on the Github repo. I'll have a look for the data, maybe I can zip it and upload it. I didn't want to have it online as obviously it was taken from jamie oliver's website. You can just use lorem ipsum :)
hello, please anyone help me
i am facing some problem
Listening to port 3000
connected
err NaN
like this. and I am refreshing then no data show in my desktop
How I solve this problem.
please reply.
How far where you in the tutorial? Where do you think that the error comes from?
@@RaddyDev await Category.insertMany([
{
"name":"Indian Thali",
"image":"latest-3.jpg"
},
{
"name":"Indian Samosa",
"image":"3.png"
},
{
"name":"Indian Biryani",
"image":"2.jpg"
},
{
"name":"Indian Samosa",
"image":"1.png"
},
{
"name":"Panir masala",
"image":"4.png"
},
{
"name":"Egg biryani",
"image":"5.png"
},
{
"name":"Panir-masala",
"image":"8.png"
}
]);
}catch(error){
console.log('err', error.message)
}
}
insertDymyCategoryData();
after inserting the data this problem throw? before inserting data this will work properly.
and as well as this will not show the data in mongodb atlas. after refreshing this how to solve this error:
Dejal D Bisen
1 day ago
hello, please anyone help me
i am facing some problem
Listening to port 3000
connected
err NaN
Try removing the await and just run the function. Alternatively you can copy the data and insert it into Mongodb manually