Тёмный

MongoDB + Python #1 - CRUD, Relationships and More 

Tech With Tim
Подписаться 1,5 млн
Просмотров 99 тыс.
50% 1

Welcome back to another video! In this video I am going to be showing how to use MongoDB in Python! More specifically I am going to be showing you how to setup a remote MongoDB database using MongoDB Atlas. I'll show you how to connect to that database in Python, explain the MongoDB document model, and also go through the CRUD operations! After that I will briefly discuss relationships using document embedding and foreign keys, and that should be everything I am going to cover! I hope you enjoy!
💻Sign up for MongoDB for FREE and get $25 in free credit using the code MKT-TIM: bit.ly/TechwTim1
MongoDB CLI Download: www.mongodb.com/docs/mongocli...
MongoDB Compass Download: www.mongodb.com/products/compass
💻 ProgrammingExpert is the best platform to learn how to code and become a software engineer as fast as possible! Check it out here: programmingexpert.io/tim and use code "tim" for a discount!
📄 Resources 📄
Fix Pip (Windows): • How to Install Pygame ...
Fix Pip (Mac): • How to Install Pygame ...
📚 Playlist: • MongoDB + Python #1 - ...
⭐️ Timestamps ⭐️
00:00 | Introduction
00:43 | What is MongoDB?
01:55 | MongoDB Atlas Setup
07:22 | PyMongo Setup
12:29 | MongoDB Compass
15:55 | MongoDB Document Model
18:18 | Inserting Documents
25:28 | Reading Documents
39:34 | Updating Documents
45:26 | Deleting Documents
46:44 | Relationships
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
👕 Merchandise: teespring.com/stores/tech-wit...
📸 Instagram: / tech_with_tim
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-ruscica-82631b179
🌎 Website: techwithtim.net
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
🎬 My RU-vid Gear: www.techwithtim.net/gear/
💵 One-Time Donations: www.paypal.com/donate?hosted_...
💰 Patreon: / techwithtim
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
⭐️ Tags ⭐️
-Tech With Tim
-MongoDB
-What is MongoDB
-Python
-Python and MongoDB
⭐️ Hashtags ⭐️
#TechWithTim #MongoDB #Python

Опубликовано:

 

15 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 91   
@jamm9848
@jamm9848 2 года назад
Thank you Tim, your youtube channel has really helped me alot ,especially with my python and web dev skills
@kos4290
@kos4290 Год назад
the best starter tutorial for mongo with python, thank you Tim
@twqwhy6763
@twqwhy6763 2 года назад
Thank you, Tim, congratulations on this partnership!
@TechWithTim
@TechWithTim 2 года назад
Thank you!
@mahmudturusnboyev7557
@mahmudturusnboyev7557 2 года назад
@@TechWithTim hello can you help me?
@Dettol68
@Dettol68 Год назад
Loved episode 1, on to episode 2! Thanks Tim, I am learning a lot!
@budoray
@budoray 2 года назад
THANK YOU for not saying, "Without further ado." Bless you my, dude. Great tutorials.
@RealtyTaj
@RealtyTaj 2 года назад
Tim is my nigga, helping me learn python, he’s a g
@light2938
@light2938 2 года назад
kinda scary that i was looking for these tutorials on Mongo yet found zero of 'em on this website, and then behold. My mentor, tim, uploads what i need :) Thank you Tim.
@robimegu3712
@robimegu3712 2 месяца назад
Thank you for opening my mind and helping me understand all this. As I come from the SQL world it helps a lot that you just put those SQL queries as a reference for certain mongo queries. thanks again! Good job Tim!
@akritworanithiphong
@akritworanithiphong 2 года назад
Great Video! Thank you, Tim and MongoDB for the great tutorials.
@universecode1101
@universecode1101 2 года назад
Perfect just today I started to learning Python
@AlbertDoes
@AlbertDoes 2 года назад
Great video Tim and congrats on the sponsorship.
@mainoraguilar698
@mainoraguilar698 2 года назад
Amazing about this partnership, you deserve it!
@logananderon9693
@logananderon9693 2 года назад
I really like the style of you writing every example as a function, so you only need to run the function once, and then can continue demonstrating things without deleting the older code.
@danielhaycraft7004
@danielhaycraft7004 Год назад
he's a great teach!
@johnfromleeds
@johnfromleeds 11 месяцев назад
@@danielhaycraft7004 Agree. The only thing I would have done differently is comment out the calls to the functions rather than delete them. As someone totally new to python (today!) I didn't pick up on that at first and wondered what was happening with the other functions as Tim introduced new functions. I'm so new to python I had to ggole how to comment out code! This is a great video as all I want to create is a quick API back end server to service my angular front end. I've seen routing in another video so should be soon good to go. Thanks Tim.
@johnfromleeds
@johnfromleeds 11 месяцев назад
That video about routing may be Tim's also!
@DanielOliveira-mb1gc
@DanielOliveira-mb1gc 5 месяцев назад
The best teacher is Tim!
@nogr3369
@nogr3369 2 года назад
Congrats on the sponsor bro, keep it up 👍
@johnfromleeds
@johnfromleeds 11 месяцев назад
Thanks Tim. This is a great video. I've added more details in replies below.
@deerbeau
@deerbeau Год назад
Thank you for this fantastic video! I have to say, the SQL queries are much more succinct than the queries using NoSQL. But I understand NoSQL could be useful and a better option in some situations.
@danielhaycraft7004
@danielhaycraft7004 Год назад
That's what i thought too, i like this but SQL feels more seamless, but I love the mongo compass! Definetly better than using PostgreSQL on the command line lol!
@anil4real_
@anil4real_ 2 года назад
Fantastic video
@IonizedComa
@IonizedComa 7 месяцев назад
12:06 in python if you want a long string split up into to 2 lines because of a styling convention without envoking extra characters like newlines you can use round brackets(): string = "This is the whole string value" string = ("This is the" "whole string value")
@hinocenciopaulo
@hinocenciopaulo 10 месяцев назад
Thank you so much!
@Masterof_None
@Masterof_None 2 года назад
I really don't know how you do that but I was working on a flask application which I want to transform its database from sql to mongodb and really struggling and now you are making a video about mongodb. you are really 🐐 man damn. Thank you for all your effort
@Masterof_None
@Masterof_None 2 года назад
FUCK I REALLY COULDN'T BELIEVE
@sumit180288
@sumit180288 2 года назад
Check out NetNinja video playlist for mongo db it's amazingly beautifully explained
@Masterof_None
@Masterof_None 2 года назад
@@sumit180288 definitely will check it out, thank you for recommend
@jehovahmbote3048
@jehovahmbote3048 11 месяцев назад
Thank you very much for this video it is really very simple to understand. Can you make a video on how to create a superuser
@user-bb7uw8st6s
@user-bb7uw8st6s 2 года назад
yey Tim i really love yout content, can u make a video about socket with server and client with proxy server
@maksimluzin1121
@maksimluzin1121 2 года назад
Just perfect !!!
@TheNerdyPlayer
@TheNerdyPlayer 2 года назад
Great video! :)
@TechWithTim
@TechWithTim 2 года назад
Thank u!
@danielhaycraft7004
@danielhaycraft7004 Год назад
i was wondering why you imported bson everytime instead of doing it once, but it makes sense when someone may skip through. unless there's a different answer to mine ! i love it!
@alexmboutchouang8281
@alexmboutchouang8281 2 года назад
Thank you Tim for this amazing video but i have et question when should we use NoSql db instead of Sql db. i mean in which kind of projects is it better to use NoSql db.
@unfuz3
@unfuz3 2 года назад
Haven't seen it yet, but i bet its a nice tutorial
@zZGIAN33Zz
@zZGIAN33Zz 2 года назад
Thanks Tim for your tutorials, they have been of great help to me! I have a request...you could make a video to explain how to upload and view an image on the database? You are great💪🏻
@mainoraguilar698
@mainoraguilar698 2 года назад
Tim is Great - Based on true History hahaha you are great Tim!!
@Lindoten
@Lindoten Месяц назад
God Bless you, May he enlight all your endeavours in live, may you live 200 years for the sake of humankind. Thank you Kindly, my fellow friend.
@tcgvsocg1458
@tcgvsocg1458 2 года назад
Thx a lot one more time
@user-ic6js9dh2u
@user-ic6js9dh2u 6 месяцев назад
Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu u get this from girl who is hard to connect mongodb and Django
@cristinocanga
@cristinocanga Год назад
Gold!
@ivannuzhyn4668
@ivannuzhyn4668 2 года назад
Please make video about The Zen of Python
@rortox1539
@rortox1539 2 года назад
In the last example (53:34) you are not using the ObjectId _id despite defining it, but only the String id. Was this on purpose? What is better practice? Anyway, thank you a lot for this great video, it really helped me :).
@timerdmann2004
@timerdmann2004 Месяц назад
I noticed that as well, plus value of field "_id" in entries of the new 'address' collection is also a plain string rather than of type ObjectId. I assume Tim forgot to convert the latter and also to use the created _id for the field 'owner_id'.
@chesswithmoiz
@chesswithmoiz Год назад
can you please make more videos on mongodb with python and sql?
@alenjelud
@alenjelud 2 года назад
Tim congrats! I'm not sure why I'm having issues with "sll:certificate_verify_failed" but this trick sorted my issue: client = MongoClient(connection_string, tls=True, tlsAllowInvalidCertificates=True) If anyone have different solution it would be much appreciated.
@santoshkumarpandit4686
@santoshkumarpandit4686 2 года назад
Try to create the mongo user again and assign the new userid and password which should work. Why: I don't know, it might the MongoDB free account behaving this way for any refreshes.
@atul7173
@atul7173 Год назад
Thanks this worked for me
@Pjotterbolte
@Pjotterbolte 2 года назад
Thank you Tim, awesome video! However, I ran into a problem connecting to the newly made MongoDB. I got the following error: [SSL: CERTIFICATE_VERIFY_FAILED] I worked around the problem by setting "tlsinsecure" to True. However is there a better way to fix this? Running python 3.10 and MongoDB is on Azure in Europe
@yasserkhelassi127
@yasserkhelassi127 9 месяцев назад
any solutions @Pjotterbolte
@TechVarLAB
@TechVarLAB Год назад
Hey Tim, count1=person_collection.find().count() I stumbled upon it: AttributeError: 'Cursor' object has no attribute 'count' is this happening because of version ?
@tomimontaana50
@tomimontaana50 Год назад
i have same isssue why is this happen
@athulkrishnadiyil1735
@athulkrishnadiyil1735 2 года назад
is beanie a good ODM for mongodb in python?
@cikaiva6776
@cikaiva6776 2 года назад
Great work here Tim, however I have been gollowing your tutorial to the letter and I keep getting pymongo.error: Bad auth {Authentication failed, 'code' : 8000, 'codeName' : 'AtlasError'} Frustrated and annoyed, I even checked to see that on password I removed < and > which is common mistake. But still I can not connect with Vscode. Frustratingggg!!! 😡😡😡😡
@tooru
@tooru 2 года назад
you could simply do `load_dotenv()`, and it automatically finds your .env file.
@tcgvsocg1458
@tcgvsocg1458 2 года назад
Can you do a create where you create game like street of rage please?
@darknights5020
@darknights5020 Год назад
Hi @Tech with Tim , as per 31:33 I am getting error count = person_collection.find().count() AttributeError: 'Cursor' object has no attribute 'count' please give a fix
@mssafy2592
@mssafy2592 Год назад
I have this problem too
@DoctorSoulis
@DoctorSoulis 2 года назад
Can we use mongoose with python/django?
@KoljaMineralka
@KoljaMineralka 11 месяцев назад
why do you use .env and then add several lines of code when you can simply add those into .bashrc file and source it ?
@hassan7522
@hassan7522 2 года назад
48:00 but why do we embedd it?. Like coudlnt we just write Street :"" Number:123 and so on
@mssafy2592
@mssafy2592 Год назад
how does vscode auto complete like that ?
@Amalgam_VR
@Amalgam_VR Год назад
Great video! maybe next time use practical names instead of "test". Makes it a little more difficult to wrap my head around when you have something like "test.test"
@gurtejbirsingh7657
@gurtejbirsingh7657 Год назад
I am getting error at7:56 while typing "pip install pymongo" please help
@BaconBitsJuice
@BaconBitsJuice 2 года назад
Thank you! I enjoyed this video a lot. Unfortunately you said the A-word at 54:09 and my mom heard you so my mom said i can't watch anymore :(
@zachfenton608
@zachfenton608 2 года назад
Great tutorial, I am having a hard time loading the dotenv file it is installed but it won't load up
@yurialmeida9630
@yurialmeida9630 2 года назад
Hey, I was having the same issue, make sure you saved (ctrl + s) the env. txt file after updating it with pwd.
@sumit180288
@sumit180288 2 года назад
No need to use dotenv you can use password directly, he has used this to hide his password
@sathyx
@sathyx 2 года назад
I actually love keyring for this.
@pseudounknow5559
@pseudounknow5559 2 года назад
Can you share the code please ? It will be helpful for me :D
@tarunreddy7
@tarunreddy7 2 года назад
'zsh: no matches found: pymongo[srv]'. Could someone please tell me why I'm getting this error?
@tarunreddy7
@tarunreddy7 2 года назад
enclose within quotes
@SarinaBeana
@SarinaBeana Год назад
@@tarunreddy7 Thank you I was looking for this!
@fndfernandu
@fndfernandu Год назад
I just got here by accident but shouldn't these functions be asynchronous? I'm an js enthusiast BTW
@jasonskipper3476
@jasonskipper3476 2 года назад
heads up for anyone who gets errors like "[SSL: CERTIFICATE_VERIFY_FAILED]", i had to pip install certifi and import it into the file, then pass it to the MongoClient like MongoClient(CONNECTION_STRING, tlsCAFile=certifi.where())
@buddha6659
@buddha6659 2 года назад
what are the best databases to use with python
@ap6471
@ap6471 Год назад
I found Sql is more handy with Java
@krithickbalakrishnan5064
@krithickbalakrishnan5064 Год назад
Which password to use in 13:28?
@tuantunguyen3874
@tuantunguyen3874 Год назад
i'm having the same question, please tell me if you figured it out
@jhonsuper7065
@jhonsuper7065 2 года назад
pin me, cuz i am subbed to your channel.
@andregt4561
@andregt4561 2 года назад
Oh it's just code, i thought i had also relationship advices lol
@navetwizer9853
@navetwizer9853 2 года назад
I wonder if the MongoDB user database is built with MonogoDB 🤣
@ankitparmar547
@ankitparmar547 2 года назад
Warning: this video contains lots of "Test" !
@tcgvsocg1458
@tcgvsocg1458 2 года назад
Music is too loud we have difficulty to hear you
@HuAAMj4pCTgx9A
@HuAAMj4pCTgx9A Год назад
Most of his code doesn't work on 2023, save your time
@ananyashukla0610
@ananyashukla0610 11 месяцев назад
pymongo.errors.OperationFailure: bad auth : authentication failed, full error: {'ok': 0, 'errmsg': 'bad auth : authentication failed', 'code': 8000, 'codeName': 'AtlasError'} I am getting this error when i am trying to display all my databases. Can anyone help me?
@30secs_facts
@30secs_facts 2 года назад
im getting this error pymongo.errors.ServerSelectionTimeoutError help me!!!!
Далее
heavy boot #tiktok
00:16
Просмотров 799 тыс.
Watch This Before Using Django With MongoDB
9:18
Просмотров 40 тыс.
Create A Python API in 12 Minutes
12:05
Просмотров 560 тыс.
Learn MongoDB in 1 Hour 🍃 (2023)
1:00:00
Просмотров 922 тыс.
MongoDB Crash Course
29:59
Просмотров 649 тыс.
10 Python Comprehensions You SHOULD Be Using
21:35
Просмотров 114 тыс.
SQLAlchemy: The BEST SQL Database Library in Python
16:39
MongoDB in 100 Seconds
2:27
Просмотров 981 тыс.