Python and MongoDB: A Quick Reference to PyMongo
2013年5月23日 11:09
Installing the MongoDB Library
$ easy_install pymongo or # sudo easy_install pymongo
Importing the MongoDB Library
from pymongo import MongoClient
Connecting to MongoDB
client = MongoClient("192.168.1.1", 27017)
Selecting a Database
client = MongoClient("192.168.1.1", 27017) db_instance = client["database_name"]