Installing MongoDB
Start Database: Installation Complete Specify database storage path Mongod.exe--dbpath c:\data\db
Run Mongo.exe successfully after entering directory
Create a database
> Use mydbswitched to db mydb> dbmydb
> book = {"title":"From beginner to master","author":"Qiwsir","Lang":"python"}{ "title":"From beginner to master", "author":"Qiwsir", "Lang":"python"}>db.books.insert (book)>Db.books.find () {"_id": ObjectId ("554F0E3CF579BC0767DB9EDF"),"title":"From beginner to master","author":"Qiwsir","Lang":"Python"}
DB points to the database Mydb,books is a collection of this database (similar to the table in MySQL), inserting a document into the collection books (the document corresponds to the record in MySQL). The databases, collections, and documents form the MONGODB database.
Use the database, just pass it use xxx , if it does not exist, build it; db.xxx Can be summed up as "follow-up with Take-on".
Installing Pymongo
pip install Pymongo
Import Pymongo>>> client = Pymongo. Mongoclient ("localhost", 27017)
Python Operation MongoDB