首页 > 代码库 > mongodb python

mongodb python

1. simple example

import pymongofrom pymongo import MongoClientcon=MongoClient(localhost,27017)db=con.db# database name "db"names=db.users # collection name "users"item=names.find_one()print item[name]

 

mongodb python