Unlocking the Power of NoSQL: FastAPI with MongoDB

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • 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/...
    Learn Chatbot Development: www.udemy.com/...
    ===========================
    🛒 GEAR & RECOMMENDED BOOKS: kit.co/codingw...
    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

КОМЕНТАРІ • 80

  • @codingwithroby
    @codingwithroby  Рік тому +7

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

  • @SAsquirtle
    @SAsquirtle Рік тому +11

    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

    • @codingwithroby
      @codingwithroby  Рік тому

      Awesome additional information!

    • @carlopignatiello2793
      @carlopignatiello2793 Рік тому +2

      Or maybe you can use motor instead of pymongo, it supports async await. Is this correct?

  • @saidA4492
    @saidA4492 Рік тому +10

    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  Рік тому

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

  • @juanpablolopezfracaro6437
    @juanpablolopezfracaro6437 Рік тому +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  Рік тому

      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 🙂

  • @Miho_13
    @Miho_13 8 місяців тому

    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.

  • @kimelironald4451
    @kimelironald4451 Рік тому +2

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

    • @codingwithroby
      @codingwithroby  Рік тому

      Thank you! I really appreciate the kind words 🙂

  • @federicorouyere4078
    @federicorouyere4078 10 місяців тому

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

  • @으짱이임
    @으짱이임 9 місяців тому +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  9 місяців тому

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

  • @pav19892
    @pav19892 Рік тому +1

    Brother superb keep making videos like this
    So much interesting stuff

    • @codingwithroby
      @codingwithroby  Рік тому

      Heck yeah! Thanks for watching and enjoying the content 🙂

  • @RedWyvern-vl7wg
    @RedWyvern-vl7wg 3 місяці тому

    that was one of the best examples out there

  • @yuriilevchenko1156
    @yuriilevchenko1156 Місяць тому

    great video, was much of help, thanks

  • @CamiloHamon
    @CamiloHamon 4 місяці тому +1

    Thanks a lot Eric! 👏

  • @efbYouTube
    @efbYouTube Рік тому +1

    excellent vid! Look fwd to seeing more!!

  • @cjacoby75
    @cjacoby75 6 місяців тому

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

  • @akazagaming1808
    @akazagaming1808 Рік тому

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

    • @codingwithroby
      @codingwithroby  Рік тому +1

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

    • @akazagaming1808
      @akazagaming1808 Рік тому

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

  • @samserm
    @samserm Рік тому +2

    Awesome!

  • @a.s8840
    @a.s8840 Рік тому +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  Рік тому +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 Рік тому

      @@codingwithroby thank you sir

  • @nithinsamuel9995
    @nithinsamuel9995 10 місяців тому

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

    • @codingwithroby
      @codingwithroby  10 місяців тому +1

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

  • @georgerussel
    @georgerussel 9 місяців тому

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

  • @ayushshaw3681
    @ayushshaw3681 Рік тому +1

    Great videos. Keep up the good work.

    • @codingwithroby
      @codingwithroby  Рік тому

      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?

  • @franku.n.1798
    @franku.n.1798 Рік тому

    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  Рік тому +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 Рік тому

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

  • @SP-db6sh
    @SP-db6sh Рік тому

    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  Рік тому +1

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

  • @saulo_foot
    @saulo_foot Рік тому +1

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

    • @codingwithroby
      @codingwithroby  Рік тому

      That is the best way for overall performance🙂

    • @dzmitry2408
      @dzmitry2408 6 місяців тому

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

  • @MahdiaAhmadi-bb6eh
    @MahdiaAhmadi-bb6eh 6 місяців тому

    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.

    • @codingwithroby
      @codingwithroby  6 місяців тому

      Noted! Thanks for being here. Cheers!

  • @jephtah737
    @jephtah737 7 місяців тому

    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

  • @jhaykei405
    @jhaykei405 Рік тому +1

    Thanks Eric!

  • @manojkbn
    @manojkbn Рік тому +1

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

    • @codingwithroby
      @codingwithroby  Рік тому

      Hmm interesting, when are you getting that error?

    • @manojkbn
      @manojkbn Рік тому

      @@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 Рік тому

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

    • @muthusivaramakrishnan3578
      @muthusivaramakrishnan3578 Рік тому

      Same device even 😂

    • @muthusivaramakrishnan3578
      @muthusivaramakrishnan3578 Рік тому

      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

  • @kevinedwards1967
    @kevinedwards1967 Рік тому

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

    • @codingwithroby
      @codingwithroby  Рік тому

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

  • @nolandgande7009
    @nolandgande7009 8 місяців тому

    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

  • @pallabdandapat1866
    @pallabdandapat1866 7 місяців тому +1

    Thank you so much

  • @Good-and-Geeky
    @Good-and-Geeky Рік тому +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  Рік тому +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 Рік тому

      @@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.

  • @MrYyope15555
    @MrYyope15555 9 місяців тому

    Awesome Thank you!

    • @codingwithroby
      @codingwithroby  9 місяців тому

      You're welcome! I am glad you found value.

  • @jasonjasonjason3030
    @jasonjasonjason3030 10 місяців тому

    11:03 is there a piano in the background

    • @codingwithroby
      @codingwithroby  10 місяців тому

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

  • @MYCALA-i7f
    @MYCALA-i7f Рік тому

    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  Рік тому

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

  • @Khanzaki1
    @Khanzaki1 Рік тому

    can you provide the github repo

    • @codingwithroby
      @codingwithroby  Рік тому

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

  • @alexes.bochkarev
    @alexes.bochkarev Рік тому

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

  • @yuha4894
    @yuha4894 Рік тому +1

    thank you