🔴 Connect MongoDB Atlas with NodeJS using Mongoose

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ม.ค. 2025

ความคิดเห็น • 54

  • @amritapattnaik3345
    @amritapattnaik3345 2 ปีที่แล้ว +2

    can someone paste the code :)

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      Sure

    • @amritapattnaik3345
      @amritapattnaik3345 2 ปีที่แล้ว +1

      @@newagecoder5417 code ?and if you have the docker file for this ?

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      const express = require("express");
      const app = express();
      const mongoose = require("mongoose");
      // Database
      const database = (module.exports = () => {
      const connectionParams = {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      };
      try {
      mongoose.connect(
      "mongodb+srv://username:password@cluster0.0ehgx.mongodb.net/mongodb?retryWrites=true&w=majority",
      connectionParams
      );
      console.log("Database connected succesfully");
      } catch (error) {
      console.log(error);
      console.log("Database connection failed");
      }
      });
      database();
      app.listen(3000, () => {
      console.log("Server is running on port 3000");
      });

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      @@amritapattnaik3345 sorry but I don't have it

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      @@amritapattnaik3345 hmm sorry u need to use your let me edit it,
      Use your BCS It will not work

  • @bartjunior1
    @bartjunior1 ปีที่แล้ว +2

    Brother, here in Brazil I really needed to learn this connection, but here it is very difficult to find someone to explain how to make the connection, I'm glad I found your video.
    For me it was a great class, you gained another follower.

    • @newagecoder5417
      @newagecoder5417  ปีที่แล้ว

      thank u soo much bro love u from india ❤❤

  • @noanswerrs
    @noanswerrs 2 ปีที่แล้ว +2

    Thanks very much for making this video, I was stuck in some tutorials that were not working, I tried this and it WORKED, amazing job, also I like this types of video where you don't talk and just have writting so you can follow along easier

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว +1

      Thank you soo much sir. Can you recommend some ideas for more videos

    • @noanswerrs
      @noanswerrs 2 ปีที่แล้ว

      @@newagecoder5417 I am actually working on a project and will need to do the steps right that come after this. If that's something you would like to do. Keep it up!

  • @raveclipsbypayrave4578
    @raveclipsbypayrave4578 2 ปีที่แล้ว +5

    Bro. I was having an issue with installing this for over 6 hours. I watched videos from even MongoDB themselves and couldn’t solve the issue. I just decided to give your video a try and it worked immediately! You’ve earned yourself a subscriber and constant video watcher! Thanks for releasing this video. I am honestly happy I found you.
    Cheers!

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      Thank u so so so much bro ❤️ for your support And you have given me a lot of motivation 🙂

    • @raveclipsbypayrave4578
      @raveclipsbypayrave4578 2 ปีที่แล้ว +1

      @@newagecoder5417 🔥

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      ​@@raveclipsbypayrave4578 Hi bro hope you are fine I need ur help. Can you help me make a video 📹. Are you facing any errors which I can help you?

    • @raveclipsbypayrave4578
      @raveclipsbypayrave4578 2 ปีที่แล้ว +1

      @@newagecoder5417 yeah. I’m finding it hard to use checkboxes in react.
      If you could make a video where you use checkboxes and display what was chosen on a single page, that’d be cool

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว +1

      @@raveclipsbypayrave4578 awesome bro video coming soon

  • @kramerkramer-yl7us
    @kramerkramer-yl7us ปีที่แล้ว +1

    thanks alot you saved me

  • @solanaromero2085
    @solanaromero2085 2 ปีที่แล้ว +1

    Thank you so much for this video. Ive been trying to connect the atlas to my project for about 2 hours now and I couldnt make it work, but thanks to you I could!!!! Omg I'm so happy! thank you thank you thank you thank you!!!!

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      🎉 congratulations bow you can start your work

  • @armansyah8892
    @armansyah8892 2 ปีที่แล้ว +1

    thank you so much bro, u already got a new subscriber here

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      🧡 thank you arman I am really glad that this video helped you

  • @saharzada9773
    @saharzada9773 2 ปีที่แล้ว +2

    thanks man really helped me here

  • @MrDubYT
    @MrDubYT ปีที่แล้ว +1

    Thanks bro. i rlly need a short video of this

  • @archipremium
    @archipremium ปีที่แล้ว +1

    thanks, your videos really helped me

  • @johncullen5903
    @johncullen5903 2 ปีที่แล้ว +2

    Thank you for this video, New Age Coder. It really helped!😀😁

  • @austinlynch7490
    @austinlynch7490 9 หลายเดือนก่อน +1

    great work

  • @aquib399
    @aquib399 ปีที่แล้ว +1

    Thanks bro and what snippets and themes are u using, they seems awesome

  • @njorogekamau3820
    @njorogekamau3820 2 ปีที่แล้ว +2

    Thanks Man !

  • @sanhtran8588
    @sanhtran8588 2 ปีที่แล้ว +1

    Thank you! It helped me to solve the problem

  • @suminbaek
    @suminbaek ปีที่แล้ว +1

    Thanks a lot!!

  • @fernandolopez6853
    @fernandolopez6853 2 ปีที่แล้ว +2

    Buen video , solucion facil y rapida👌👍

  • @cagr9944
    @cagr9944 ปีที่แล้ว +1

    Thanks

  • @mohamedelaatfi1162
    @mohamedelaatfi1162 ปีที่แล้ว

    THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUU

  • @sahilraut8758
    @sahilraut8758 ปีที่แล้ว +1

    bro it's showing me error by saying database connection is failed

    • @newagecoder5417
      @newagecoder5417  ปีที่แล้ว

      Hi Sahil, did you paste the password and username correctly for Moongodb connection as shown in the 13th line please check and let me know

  • @khumbozimba7521
    @khumbozimba7521 2 ปีที่แล้ว +1

    what extension are you using for the autocompletion?

  • @sushantdivekar6013
    @sushantdivekar6013 ปีที่แล้ว +1

    🙏

  • @aiswaryam6298
    @aiswaryam6298 ปีที่แล้ว

    Showing error in connection of ip address,

  • @mohalhakeem
    @mohalhakeem 2 ปีที่แล้ว

    Instead of typing in Notepad you can use free video apps such as DaVinci Resolve and add text on the video...

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว +1

      Thank u for your opinion sir, I will definitely do it

  • @sanchalisharma9149
    @sanchalisharma9149 2 ปีที่แล้ว

    distracted constantly by notepad

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      const express = require("express");
      const app = express();
      const mongoose = require("mongoose");
      // Database
      const database = (module.exports = () => {
      const connectionParams = {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      };
      try {
      mongoose.connect(
      "mongodb+srv://username:password@cluster0.0ehgx.mongodb.net/mongodb?retryWrites=true&w=majority",
      connectionParams
      );
      console.log("Database connected succesfully");
      } catch (error) {
      console.log(error);
      console.log("Database connection failed");
      }
      });
      database();
      app.listen(3000, () => {
      console.log("Server is running on port 3000");
      });

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว

      take this code and paste it on your file and change the username and password thank u

    • @sanchalisharma9149
      @sanchalisharma9149 2 ปีที่แล้ว +1

      @@newagecoder5417 and I was so frustrated because of that I watched your video and still get nothing. So I wrote that.🙂🙂

    • @newagecoder5417
      @newagecoder5417  2 ปีที่แล้ว +1

      @@sanchalisharma9149 No problem, is it working now?

    • @sanchalisharma9149
      @sanchalisharma9149 2 ปีที่แล้ว

      @@newagecoder5417 unfortunately no . I have put the whole URL directly . .env is not working.