Build A Command Line Interface With Node.js & MongoDB

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

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

  • @ganeshmajhi1065
    @ganeshmajhi1065 7 ปีที่แล้ว +6

    I just completed building this application , This is amazing .. Looking forward for more awesomeness :-)

    • @TraversyMedia
      @TraversyMedia  7 ปีที่แล้ว

      Awesome!

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

      brother i get UnhandledPromiseRejectionWarning : type error: db.close is not a function. pls help me how to solve it .

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน

      Hi, @ganeshmajhi1065

  • @raviverma8904
    @raviverma8904 7 ปีที่แล้ว +30

    Building a CLI thats fuckin cool , thanks brad

    • @TraversyMedia
      @TraversyMedia  7 ปีที่แล้ว +12

      Thanks! Yeah I wanted to do something different today :)

  •  7 ปีที่แล้ว +4

    I seriously think you're somehow reading my mind. Not only do you come up with a video tutorial for Django (when I just started studying it); but now it's creating a CLI? Wow... O_O

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน

      Hi, @YahananRiviere

  • @ajit555db
    @ajit555db 6 ปีที่แล้ว +5

    When we were building apps in .net, cli apps were huge time and resources saver, and often, they used to outlive the various GUI app versions. Though it was for in-house dev team, for our SaaS app, even the advanced user customers used to love it. Migrating to Node.js world, and can not thank enough for this useful video.

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน

      Hi, @ajitsingh4346

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

    Totally loved this tutorial,will def be your patreon when i get a job.Thank you so much!

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน

      Hi, @Simbatronix

  • @biswamohandwari6460
    @biswamohandwari6460 3 ปีที่แล้ว

    He knows while teaching that people are watching this video other youtubers teach themselves

  • @juancamiloq1
    @juancamiloq1 7 ปีที่แล้ว +9

    Not even seen the video yet. opened youtube just to tankyou man!

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

    Thanks so much, Brad. I really appreciate this. You have no idea how this has helped me

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน

      Hi, @gracefrank5692

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

    i think it makes more sense to close the db on finally not then. Also cli seems to hang when it gets a command it doesn't know.

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

    Check out the cli-notes app I created with the same technologies used in this video!!
    github.com/yTakkar/cli-notes

  • @hnl22
    @hnl22 6 ปีที่แล้ว

    Hey dude, thank you for show me your knowledge, today I learned good practices and I already could make a global cli tool ... Amazing!

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน

      Hi, @hnl22

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

    Hello, I am very grateful for your guide, but I have an error (24:41), instead of Adding Customer:
    customer-cli/node_modules/mongodb/lib/connection_string.js:286
    throw new error_1.MongoParseError(`${optionWord} ${Array.from(unsupportedOptions).join(', ')} ${isOrAre} not supported`);
    I suppose that part of your code is deprecated. Please, help me to find a solution. Thank you

  • @MakeAppswithDanny
    @MakeAppswithDanny 3 ปีที่แล้ว

    Thanks so much Brad, this was really helpful.

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

    Haven't watched yet, but I already know it's good! Thanks

    • @abhinashbihari2881
      @abhinashbihari2881 4 ปีที่แล้ว

      Those who only do copy paste .For those it's good video because Brad is master in copy paste

    • @raulsanchez8460
      @raulsanchez8460 4 ปีที่แล้ว

      Bihari Brothers lololol

    • @abhinashbihari2881
      @abhinashbihari2881 4 ปีที่แล้ว

      @@raulsanchez8460 I said the right thing. I had watched all the videos of Node.js and Not in single one He had explained anything,All the time I had to see the documentation to understand that thing

  • @salihcandusmez1731
    @salihcandusmez1731 7 ปีที่แล้ว +16

    i hope one day you will make series about making a javascript library/framework.
    Btw thank you for awesome videos take care !
    (sorry about my English :))

    • @Toochilledtocare-_-
      @Toochilledtocare-_- 7 ปีที่แล้ว +4

      no issues with your english dude

    • @brandtleymcminn
      @brandtleymcminn 7 ปีที่แล้ว +9

      Making a framework is too nebulous a concept, since frameworks come in all shapes and sizes that do lots of different things for different reasons.
      If you know JavaScript and have an idea for some resource that makes doing certain things easier, then you can create a framework. The tricky part is how to package your code so it's usable, testable, and then to deploy it to a package management service.
      So I don't think "How to make a framework" is a good idea for a series, but "How to package you project" or something like that detailing testing and distribution on something like NPM would be a good topic/series.

    • @krypto7264
      @krypto7264 6 ปีที่แล้ว

      Aren't there any tutorial videos out there?

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

    Great video. Maybe as an idea for a follow up would be to make the update read in the current values to be edited.

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน

      Hi, @JasonWierakaJDub

  • @capricon2291
    @capricon2291 4 ปีที่แล้ว

    Hi Traversy,
    You save my job, Thanks man.
    Happy Coding..

    • @parameswaran5240
      @parameswaran5240 4 ปีที่แล้ว

      brother i get UnhandledPromiseRejectionWarning : type error: db.close is not a function. pls help me how to solve it .

  • @teacherrussell5206
    @teacherrussell5206 4 ปีที่แล้ว

    Around 20:00 when I used program.parse(process.argv) and tried to run it, I got a million warnings and errors and deprecation warnings. Is this somehow that outdated already, or is it me?:)

  • @argeelearner3978
    @argeelearner3978 7 ปีที่แล้ว

    Thanks Brad, I love your stuff. When I see a new video, you make my day.

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน

      Hi, @argeelearner3978

  • @matthewfallon6564
    @matthewfallon6564 7 ปีที่แล้ว +7

    Really Interesting tutorial Brad! Was wondering if you would be able to make a video on Live Video Streaming with WebRTC? Would be a cool project

  • @ashadnasim8103
    @ashadnasim8103 5 ปีที่แล้ว +4

    for all who are struggling with db.close throwing error ,
    use
    mongoose.connection.close()
    instead......

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

      Thank you lol

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

      Thanks for the fix..
      Also getting depreciation warnings on useMongoClient:
      Use the following instead of above
      useUnifiedTopology: true, useNewUrlParser: true, useCreateIndex: true

    • @suwidnyana8520
      @suwidnyana8520 4 ปีที่แล้ว

      thank you bro

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

      @@javieryzaguirre4257 you can use this inside Mongoose.connect with curly braces and copy these two code

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

    You are awesome Brad!

  • @iroshanaravishan1388
    @iroshanaravishan1388 3 ปีที่แล้ว

    Wow🤩 it works perfectly. Superb ✌🙌🏁

  • @Bilal-le3nw
    @Bilal-le3nw 7 ปีที่แล้ว

    That's so useful! I already create my own CLI to generate a AngularJS module :>. Thx alot

    • @u21cs101
      @u21cs101 8 หลายเดือนก่อน +1

      Hi, @Bilal-le3nw

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

    love this, thanks so much your tutorials are the best :)

  • @GammerAdam
    @GammerAdam 7 ปีที่แล้ว +3

    I see you've uploaded the code to GitHub. Very convenient for us this way, Thank you :-)

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

    love this tutorial! Is there a reason data persists after exiting the CLI and exiting the mongo server? I want the data to clear out but it seems like it's cached

  • @aminsherzad638
    @aminsherzad638 7 ปีที่แล้ว

    Thanku for sharing Brad, useful tutorial

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

    Hey Brad if you could explain arrow functions that would be great with explanation of examples.

    • @abhinashbihari2881
      @abhinashbihari2881 4 ปีที่แล้ว

      He know only how to copy paste the code .He don't know how to explain it and when He will explain also u can't understand also I am not believing till now how can he get so many subscribers only by doing copy paste the code

  • @live2code861
    @live2code861 6 ปีที่แล้ว

    Hi Brad, Please help me find that this cli could be deployed without the prerequisites of node in windows machines just like electron?

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

    Thank you, Brad!!

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

    Wow...You’re rule Brad!!!

  • @poul_yvarov
    @poul_yvarov 6 ปีที่แล้ว

    Thank you, great explanation!

  • @abhinashbihari2881
    @abhinashbihari2881 4 ปีที่แล้ว

    My find function is not working when I type node commands.js find (anyname) then it gives all the customers which was present in my database

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

    Bless up Brad.

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

    this is very useful on system building right?

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

    Brad please make video on Bot Application using node js

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

    I get an error saying Operation customer.insertOne() buffering times out after 10000ms. Also I think this code is deprecated.

  • @abdelrhmanelsaid4589
    @abdelrhmanelsaid4589 5 ปีที่แล้ว

    what if you want it with login and the program don't close and wait for others commands after login

  • @ReesRetuta
    @ReesRetuta 6 ปีที่แล้ว

    great video man

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

    excellent video

  • @hirephpdevelopers3840
    @hirephpdevelopers3840 7 ปีที่แล้ว

    Thanks Brad!

  • @ДавидМеликян-ш1н
    @ДавидМеликян-ш1н 7 ปีที่แล้ว

    Brad, can you do something like DigitalOcean Crash Course going deeper into various droplet setup options and paid features such as Backups and stuff like that? And I also hope one day you will do Deploy Something to CloudFlare. Thank you in advance :)

  • @livinghumanz1163
    @livinghumanz1163 6 ปีที่แล้ว

    mr brad can i know how can i convert my cli into an application just like terminal in linux

  • @yashsomaiya8544
    @yashsomaiya8544 7 ปีที่แล้ว +5

    Hello traversy, can u please reupload the PHP PDO login system, if possible..!!!

  • @5ervanttechintel_github_io979
    @5ervanttechintel_github_io979 5 ปีที่แล้ว

    Now, how to distribute that CLI with MongoDB as an npm package?

  • @richardwilliam7030
    @richardwilliam7030 4 ปีที่แล้ว

    Hey brad, how do i connect this to this terminal to your node js masterclass api course, Can you please help

  • @rajdhanki8740
    @rajdhanki8740 7 ปีที่แล้ว

    Brad is God for me

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

    i;d like to know the real day utility of this i mean CLI for customer kind stuff.

    • @chinmaytare7020
      @chinmaytare7020 6 ปีที่แล้ว

      CLI may seem intimidating at first but its quite convenient than complex UIs

  • @ahmedjahmi5704
    @ahmedjahmi5704 4 ปีที่แล้ว

    hey brad, everything works great. then i tried using dotenv to store my db uri and i keep getting and undefined error. i've required dotenv at the top of index.js, i've tried storing the uri in my .env file with and without quotes, i've tried passing it into the mongoose connect method as process.env.VARIABLE_NAME and tried storing that in an variable called uri and then passing uri in, and still no luck. any chance you or someone reading this can help? thanks!

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

      Use :
      require("dotenv").config() make sure to add .config()

  • @msainikitha
    @msainikitha 7 ปีที่แล้ว

    Thanks brad :)

  • @enfantprodigue4549
    @enfantprodigue4549 7 ปีที่แล้ว

    Thank you Brad

  • @TheBadFred
    @TheBadFred 7 ปีที่แล้ว

    I wounder if it makes sense to use TypeScript for node.

    • @devilmanscott
      @devilmanscott 7 ปีที่แล้ว

      It's fine, just like Flow, it just requires a bit of setup, but there's nothing wrong with it, though if you only using it for the type checking just use flow.

    • @RockCYP
      @RockCYP 6 ปีที่แล้ว

      It does makes sense actually. You can find a starter i made here - github.com/pitops/nodetype-starter

  • @ConquerJS
    @ConquerJS 7 ปีที่แล้ว

    I know I already asked for this a while back, but would you consider doing a crash course on setting up a dev environment in Windows with WSL Bash? I should prob post this request on Patreon.

    • @TraversyMedia
      @TraversyMedia  7 ปีที่แล้ว

      I have a whole mess of things on my list and that has been one of them for a while. I actually did one a long time ago but was not happy with it so I scrapped it. I have been meaning to re-do it. I do not use it in videos because I need to keep things as simple as possible and as compatible as possible for others. Plus I am content with Git Bash or if I want to use Linux, I have 5 vms with Ubuntu/Mint.

  • @coolarun3150
    @coolarun3150 7 ปีที่แล้ว

    Interesting video, pls do vidoe on webrtc

  • @parameswaran5240
    @parameswaran5240 4 ปีที่แล้ว

    brother i get UnhandledPromiseRejectionWarning : type error: db.close is not a function. pls help me how to solve it .

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

      instead of db.close() the way he has it, try mongoose.disconnect() ..also, for a cleaner look, instead of const db = mongoose.connect(yourMongoUrlAndStuffHere) ...try setting db = mongoose; and then, use db.connect(yourMongoUrlAndStuffHere) and so you can then just use db.disconnect() instead of mongoose.disconnect() like i said at first ...but either way, the .close() method doesn't work..i think because .close() is a method of mongoose.connection ...so mongoose.connection.close() might work as well, but i haven't tried. hope this helps!

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

      @@ahmedjahmi5704 Thanks, man !! it helped a lot

    • @ahmedjahmi5704
      @ahmedjahmi5704 3 ปีที่แล้ว

      @@tanayraj2991 no problem, happy I could help :)

  • @patryksen8560
    @patryksen8560 4 ปีที่แล้ว

    Name of the application or interface u mean what ?

  • @Daniel20030
    @Daniel20030 6 ปีที่แล้ว

    How do I make the type of a field in the schema an Array? just { type: Array }??
    I hope someone can help me out!
    Anyways, Great tutorial!!

  • @alisham5665
    @alisham5665 6 ปีที่แล้ว

    Brad its not working in Linux Environment!!!Please help

  • @MrHumanwarrior
    @MrHumanwarrior 5 ปีที่แล้ว

    How to do this without mongoose?

  • @ChrisOrillia
    @ChrisOrillia 6 ปีที่แล้ว

    Thank you.

  • @mamniki7107
    @mamniki7107 7 ปีที่แล้ว

    what do we want premium my baby .
    no we want that you put more video like this :-)))))

  • @VladShpak
    @VladShpak 5 ปีที่แล้ว

    Many thanks!!!!

  • @ЕвгенийШек-п2щ
    @ЕвгенийШек-п2щ 6 ปีที่แล้ว

    Amazing!

  • @scottrider3142
    @scottrider3142 5 ปีที่แล้ว

    Fucking Legend M8 honestly

  • @ParikshitPandya
    @ParikshitPandya 7 ปีที่แล้ว

    Why do you use windows PC? Why not Linux or Mac?

    • @TraversyMedia
      @TraversyMedia  7 ปีที่แล้ว

      A few reasons.
      - Beginner friendly
      - I am a PC Enthusiast. I love building PCs (and using them)
      - Check out my 6 monitor setup tour. Cant do that with a mac
      - Did computer repair for a long time so I am a Windows guy
      - Recording software
      - No reason to. Windows 10 has gotten a lot better. Nothing I did in this video or any video is easier on another OS.

    • @ashadnasim8103
      @ashadnasim8103 5 ปีที่แล้ว

      @@TraversyMedia now you had switched to mac os .................

  • @michongoma7598
    @michongoma7598 7 ปีที่แล้ว

    Awesome!!

  • @raisshaikh259
    @raisshaikh259 7 ปีที่แล้ว

    thank you

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

    Plz upload php pdo crash course

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

      Already have one, search the channel. I made it around a month ago

    • @rajdhanki8740
      @rajdhanki8740 7 ปีที่แล้ว

      @Traversy Media thanx

  • @hiteshchoudhary3412
    @hiteshchoudhary3412 7 ปีที่แล้ว

    Awesome

  • @abhinashbihari2881
    @abhinashbihari2881 4 ปีที่แล้ว

    Normal TH-camr is better than Brad . Although they don't make good content but what they make it they understand that thing properly.Not like u Just copy paste the code and not understanding anything

  • @BJarvey
    @BJarvey 7 ปีที่แล้ว

    im third?? crap. oh well let us learn :)

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

    First heheh

  • @ahmedfouzan
    @ahmedfouzan 7 ปีที่แล้ว

    I'm 245th

  • @abhinashbihari2881
    @abhinashbihari2881 4 ปีที่แล้ว

    You don't know how to teach only u r writing the code without explaining anything and that's why I am facing problem to understand and I have to see the documentation for those things

  • @anand_-
    @anand_- 7 ปีที่แล้ว +1

    Second

    • @nexus0709
      @nexus0709 7 ปีที่แล้ว

      wtf are you doing here kid?