Unlocking the Power of NoSQL: FastAPI with MongoDB

Sdílet
Vložit
  • čas přidán 20. 05. 2023
  • In this video, we will guide you through the process of creating a Python FastAPI application with MongoDB, a powerful NoSQL database.
    🎥 React + FastAPI: • How to build a React +...
    🎥 AWS Lambda + FastAPI: • Deploy FastAPI on AWS ...
    🎥 MySQL + FastAPI: • How to build a FastAPI...
    🎥 PostgreSQL + FastAPI: • How to build a FastAPI...
    ===========================
    🎓 Courses can be found:
    FastAPI Beginner & Advanced: www.udemy.com/course/fastapi-...
    Learn Chatbot Development: www.udemy.com/course/the-comp...
    ===========================
    🛒 GEAR & RECOMMENDED BOOKS: kit.co/codingwithroby
    Python FastAPI has gained tremendous popularity as a high-performance, easy-to-use framework for building web applications and APIs. Combining FastAPI with MongoDB noSQL allows us to leverage the flexibility and scalability of a document-oriented database, making it an excellent choice for modern web development.
    Throughout this tutorial, we will cover the essentials of setting up a FastAPI project, integrating MongoDB as our database, and implementing various CRUD (Create, Read, Update, Delete) operations. Whether you're a beginner or an experienced Python developer, this tutorial will provide valuable insights into building robust and efficient web applications.
    Here's a sneak peek at what we'll cover in this video:
    Introduction to FastAPI: We'll start by introducing FastAPI and highlighting its key features that make it a top choice for web development.
    Setting Up the Project: We'll guide you through the process of creating a new FastAPI project and setting up the necessary dependencies. We'll also cover the installation of MongoDB and the required Python libraries for working with it.
    Connecting to MongoDB: You'll learn how to establish a connection to a MongoDB database from your FastAPI application. We'll demonstrate how to configure the connection settings.
    CRUD Operations: We'll dive into the core functionality of our application by implementing CRUD operations using FastAPI and MongoDB. You'll see how to create, retrieve, update, and delete documents in the database using FastAPI's intuitive syntax.
    By the end of this video, you'll have a solid understanding of building a Python FastAPI application with MongoDB as your database. Whether you're looking to develop RESTful APIs, microservices, or full-stack web applications using FastAPI and Python, this tutorial will equip you with the skills you need to get started.
    Make sure to like this video, subscribe to our channel, and hit the notification bell to stay updated with our latest tutorials on web development, Python, and more. Let's dive into the exciting world of FastAPI and MongoDB noSQL together!
    #fastapi #mongodb #python

Komentáře • 79

  • @codingwithroby
    @codingwithroby  Před rokem +6

    Python 3.12 is out now in pre-release! Like & comment what you want to learn next 🙂

  • @night23412
    @night23412 Před rokem +9

    something to note, do not use async routes when writing blocking synchronous code inside them such as pymongo queries. This will prevent FastAPI from running the sync code in a thread pool since it assumes that the code inside can be awaited in an event loop. For more info check out the "in a hurry?" section of the async page in the FastAPI docs

  • @Miho_13
    @Miho_13 Před 6 měsíci

    Thank you so much, you were very clear and the code works well! I was struggling a bit with updating the post, put and delete functions on the browser with VS code.. in the end I just had to "save" files for them to take effect. Whoever is wondering if this video is worth going through, I would say 100% it is - I am an absolute beginner and managed to follow it through.

  • @efbYouTube
    @efbYouTube Před rokem +1

    excellent vid! Look fwd to seeing more!!

  • @saidA4492
    @saidA4492 Před rokem +9

    Thank you for the detailed explanations. Your enthusiasm and passion for what you do are inspiring and have encouraged me. Wish you the best man!

    • @codingwithroby
      @codingwithroby  Před rokem

      This is awesome 🙂 thank you for the nice message!!

  • @pav19892
    @pav19892 Před rokem +1

    Brother superb keep making videos like this
    So much interesting stuff

    • @codingwithroby
      @codingwithroby  Před rokem

      Heck yeah! Thanks for watching and enjoying the content 🙂

  • @federicorouyere4078
    @federicorouyere4078 Před 8 měsíci

    Excellent! You explain everything so clearly, even for a person who doesn't speak your language.

  • @cjacoby75
    @cjacoby75 Před 3 měsíci

    Beautiful. Just what I wanted to know. Thank you.

  • @CamiloHamon
    @CamiloHamon Před 2 měsíci +1

    Thanks a lot Eric! 👏

  • @samserm
    @samserm Před rokem +2

    Awesome!

  • @RedWyvern-vl7wg
    @RedWyvern-vl7wg Před měsícem

    that was one of the best examples out there

  • @user-hk4ch9kh1p
    @user-hk4ch9kh1p Před 7 měsíci +1

    Thank you for your explanation video! I had some problems to write code, but with your explanation, I'm sure that I can solve them! 😀

    • @codingwithroby
      @codingwithroby  Před 7 měsíci

      You are so welcome, friend! I am glad you find it helpful

  • @nithinsamuel9995
    @nithinsamuel9995 Před 8 měsíci

    Thank you so much for the video, Crisp and clear example

    • @codingwithroby
      @codingwithroby  Před 8 měsíci +1

      Much appreciated! I am glad you were able to get value 🙂

  • @akazagaming1808
    @akazagaming1808 Před 11 měsíci

    Thank you so much! Looking forward to your FARM stack. With you the best sir.

    • @codingwithroby
      @codingwithroby  Před 11 měsíci +1

      Haha I feel like there was a hidden *wink wink* in your comment :-)

    • @akazagaming1808
      @akazagaming1808 Před 11 měsíci

      wish you*, i just want to learn the FARM stack :< and i hope you can make a video on that.

  • @ayushshaw3681
    @ayushshaw3681 Před 11 měsíci +1

    Great videos. Keep up the good work.

    • @codingwithroby
      @codingwithroby  Před 11 měsíci

      Thank you, friend! I am glad you were able to find value. Is there anything specific you would like to learn that I can add to my backlog?

  • @kimelironald4451
    @kimelironald4451 Před 10 měsíci +2

    Impressive presentaion! What I want to learn is relationship inside mongo db.

    • @codingwithroby
      @codingwithroby  Před 10 měsíci

      Thank you! I really appreciate the kind words 🙂

  • @juanpablolopezfracaro6437
    @juanpablolopezfracaro6437 Před 11 měsíci +3

    I like the video, however, I have a suggestion.
    Don't put the music that low, is just annoying.
    I don't care if there is no music (better for me) or mildly loud (I suppose better for someone), but that low is just annoying.

    • @codingwithroby
      @codingwithroby  Před 11 měsíci

      Thanks for the suggestion! I’m trying to learn the perfect audio for everything (it’s harder than it may seem with everyone having different devices). Again, I appreciate the advice 🙂

  • @georgerussel
    @georgerussel Před 6 měsíci

    What if I would like to delete by "description"?

  • @jhaykei405
    @jhaykei405 Před 10 měsíci +1

    Thanks Eric!

  • @MrTomer157
    @MrTomer157 Před 7 měsíci

    Awesome Thank you!

  • @jephtah737
    @jephtah737 Před 5 měsíci

    can you do relationships on this Mongo DB with fastAPI that I can relate to your FastAPI Udemy course? i want to rebuild the project on that course but using Nosql

  • @franku.n.1798
    @franku.n.1798 Před 11 měsíci

    This is so awesome and is worth every time spent to follow the tutorial. thank you. however can you do a tutorial with FastApi + Mongodb + graphql + React ?

    • @codingwithroby
      @codingwithroby  Před 11 měsíci +1

      Great suggestion! I will add this to my backlog of future content. I cannot promise when it will be created though 🙂

    • @franku.n.1798
      @franku.n.1798 Před 11 měsíci

      @@codingwithroby I already appreciate the response. Am excited already

  • @nolandgande7009
    @nolandgande7009 Před 6 měsíci

    Thank you so much, that was a wonderful follow through video of monogdb and fastapi that i have ever come accress. Just one issue, I encountered this error [pymongo.errors.ConfigurationError: The DNS response does not contain an answer to the question: _mongodb._tcp.. IN SRV]. the python driver link is also different [python -m pip install "pymongo[srv]"==3.11]. I did install python 3.12 and tried but still facing the same error. tried searching the web but couldn't find solution to that. my initial python version was 3.11.7 Could you help me on that? Thank you

  • @MahdiaAhmadi-bb6eh
    @MahdiaAhmadi-bb6eh Před 3 měsíci

    Thank you for the nice explanation, really appreciate your hard work in creating helpful content. and for the next videos, can you upload some videos about React js.

  • @pallabdandapat1866
    @pallabdandapat1866 Před 4 měsíci +1

    Thank you so much

  • @saulo_foot
    @saulo_foot Před rokem +1

    So if I have multiple collections I must create a kind of list_serial for each collection?

    • @codingwithroby
      @codingwithroby  Před rokem

      That is the best way for overall performance🙂

    • @dzmitry2408
      @dzmitry2408 Před 4 měsíci

      @@codingwithrobywhy don’t you use .dict() method of pydantic models?

  • @user-sh1qb3ce5d
    @user-sh1qb3ce5d Před 11 měsíci

    i am getting Internal Server Error for the first get request,i was supposed to get empty, can you please help me out

    • @codingwithroby
      @codingwithroby  Před 11 měsíci

      Hmm, what error is your application throwing? Anything pointing us in the right direction?

  • @a.s8840
    @a.s8840 Před rokem +1

    Hi sir,can you please tell me a roadmap to learn python with data structures and algorithms and after that I want to look into backend also please please tell me ...

    • @codingwithroby
      @codingwithroby  Před rokem +2

      I have that coming in a future video 😀 the overall best advice would be to learn the absolute basics and then try to create a project. Creating a project will really help accelerate learning, as you find real life problems you need to try and solve!

    • @a.s8840
      @a.s8840 Před rokem

      @@codingwithroby thank you sir

  • @SP-db6sh
    @SP-db6sh Před rokem

    Can you plz create a video on user activity daily progress report app with FastApi, MongoDB, Streamlit ?
    Thank you for your humble effort

    • @codingwithroby
      @codingwithroby  Před rokem +1

      I'll add it to content I want to make in the future :-) Make sure you subscribe to get notified of all content!

  • @manojkbn
    @manojkbn Před 11 měsíci +1

    Unable to ping to the database, Error: [SSL: CERTIFICATE_VERIFY_FAILED] while reloading the server.

    • @codingwithroby
      @codingwithroby  Před 11 měsíci

      Hmm interesting, when are you getting that error?

    • @manojkbn
      @manojkbn Před 11 měsíci

      @@codingwithroby I was following/practicing your video and reached 8:12, I am using MacBook Air, and Python 3.12 in Virtual env.
      I completed your FastAPI + MySQL, it is an awesome stuff and big thanks for your efforts. 🙂

    • @muthusivaramakrishnan3578
      @muthusivaramakrishnan3578 Před 10 měsíci

      @@manojkbnsame error bro if you get a solution pls help me out

    • @muthusivaramakrishnan3578
      @muthusivaramakrishnan3578 Před 10 měsíci

      Same device even 😂

    • @muthusivaramakrishnan3578
      @muthusivaramakrishnan3578 Před 10 měsíci

      Bro I fixed that error it’s quite of a dumb fix I downgraded my version to 3.11 and then used tlsCAFile=certifi.where() in order to avoid that certificate issue I hope it helps

  • @alexes.bochkarev
    @alexes.bochkarev Před 11 měsíci

    Спасибо! Это достаточно просто

  • @kevinedwards1967
    @kevinedwards1967 Před 11 měsíci

    Great content. Background music is a bit distracting in my opinion

    • @codingwithroby
      @codingwithroby  Před 11 měsíci

      I am glad you were able to find value! Thank you for the suggestion!!

  • @Good-and-Geeky
    @Good-and-Geeky Před rokem +1

    Would be cool to see how you can make use of these API in a web app. Flask or React ?? Probably Flask with it being easier...

    • @codingwithroby
      @codingwithroby  Před rokem +1

      Hmm interesting - so perhaps how you can use FastAPI as a BE along a React FE Project? Is this what you were thinking? Or how to use FastAPI to build full stack project using a server side rendering library?

    • @Good-and-Geeky
      @Good-and-Geeky Před 11 měsíci

      @@codingwithroby What I want to see is how to connect the front end to this. I have worked out using Jinja templates. So I have a form and I want the data to go to the Mongo database. Yes a full stack project using FastAPI, Mongo and with Jinja templates.
      I have been able to get this working Mongo and FastAPI. Also got FastAPI working to give web pages using Jinja templating .
      Struggling to get the three parts working together.

  • @jasonjasonjason3030
    @jasonjasonjason3030 Před 8 měsíci

    11:03 is there a piano in the background

    • @codingwithroby
      @codingwithroby  Před 8 měsíci

      Haha - it is the background music. I have increased the background music of recent videos. You live and you learn!

  • @Khanzaki1
    @Khanzaki1 Před 10 měsíci

    can you provide the github repo

    • @codingwithroby
      @codingwithroby  Před 10 měsíci

      I am sorry, I did not save the code repository for this video.

  • @yuha4894
    @yuha4894 Před rokem +1

    thank you