How to connect mongodb with python

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
actually i'm going to connect python with mongodb so here first we need to install the important package by so let's open the command prompt and here if i search if i type and type python i press enter so here you can get the python 3.95 latest version that install so when that to install after that let's op cancel and open the command plot once again and first we need to install the package called pi now paste there so pip install pi mango here collecting pie using gas and the size 383 kb and installing collection it's successful so this package that installed successful now thereafter we need to use this occurred so here grind by so first that import the baggage by mango here hereafter client by mango client here you need to specify this address here my db equal to client this is the new or database that i'm going to create inside the uh mongodb thereafter information equal to mydb and this is the table on new table that i'm going to create and this particular record that going to a store inside there and here when this is the record and information dot is insert many so this will insert this records so let's uh check that so here first let's open command prompt and here if i write that here you get this message longer sale version 4.46 it already installed okay so first you need to install the mongodb and there after install and set the path and if i click here sorry not this item let's close that i'm going to open noise square booster for mongodb so here there is no any percent employee database percent there okay now let's open any of your favorite browser sorry any of your favorite id for log python so here i'm using visual studio code so you can use any so here let's open the file okay any file you can open so extension should be dot py after that here let's select this all and paste this code so import by package here this is the address and so here this is the employee now here in no sql booster there is no any employee so when that got that to run successfully here the one employee database that created and inside database table table one and this record inside there so let's click on a start here python file so here it's so running without any iso okay it's so successfully run because there is no any problem with this code after that here let's open a nosql booster or you can here just cancel that and open once again so here you can see employee table that created and inside table sorry empire employee database created and inside table one is there so when i click here here you can see this piece of information you can see so let's use here so this is employee id now here you can see this is employee id 7 9 3 4 miller clerk like that by using this let's so here change the database name implies that i'm giving and here this is table two and chance here five and this one 20 now this time let's open here command prompt and writing and here writing so dbs so davis same place you can see this all those things you can see now or this time here i did a little chances table to employees now let's run this code once again python file now it's so run successfully without any iso now here if i saw dbs here you can see employees on new db that created and if you want to see the record inside the gui let's open this time studio 330 so studio 3d it's opening it's also based on gui for mongodb and here next is let's click on the connection here you can see employees and employee to database that is just created here inside table 2. so this is the record 7 9 35 miller and dpt number 20 that i inserted so this is the simplest way we can connect with the mongodb and python so what i'm going to repeat this code so fast here you need to install this important package called pi after that here import the buy package here client required to buy that call client and this address here my db equal to client and the inside you need to pass the database here information to mydb that creator or that is the table name this information that i'm going to insert so when this information right there after that use in formation dot insert many so here this record this all record that inserted so insert many that means you can insert multiple records many records so i hope guys this video is helpful for you so now in this video it's over so thanks for watching see you next week thank you
Info
Channel: Adam Tech
Views: 18,032
Rating: undefined out of 5
Keywords: python programming, mongodb, software tutorial
Id: whL3AgY0Ppc
Channel Id: undefined
Length: 7min 42sec (462 seconds)
Published: Mon Jun 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.